Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1497366

Re: [PATCH] use a nocache copy for bvecs in copy_from_iter_nocache()

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH] use a nocache copy for bvecs in copy_from_iter_nocache()
Date 2016-10-07 19:10 +0200
Message-ID <spGOJ-3x4-3@gated-at.bofh.it> (permalink)
References <spFJ0-2xt-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Oct 07, 2016 at 10:55:11AM -0500, Brian Boylston wrote:
> copy_from_iter_nocache() is only "nocache" for iovecs.  Enhance it to also
> use a nocache copy for bvecs.  This improves performance by 2-3X when
> splice()ing to a file in a DAX-mounted, pmem-backed file system.

> +static void memcpy_from_page_nocache(char *to, struct page *page, size_t offset, size_t len)
> +{
> +	char *from = kmap_atomic(page);
> +	__copy_from_user_inatomic_nocache(to, from, len);
> +	kunmap_atomic(from);
> +}

At the very least, it will blow up on any architecture with split
userland and kernel MMU contexts.  You *can't* feed a kernel pointer
to things like that and expect it to work.  At the very least, you
need to add memcpy_nocache() and have it default to memcpy(), with
non-dummy version on x86.  And use _that_, rather than messing with
__copy_from_user_inatomic_nocache()

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] use a nocache copy for bvecs in copy_from_iter_nocache() Brian Boylston <brian.boylston@hpe.com> - 2016-10-07 18:00 +0200
  Re: [PATCH] use a nocache copy for bvecs in copy_from_iter_nocache() Al Viro <viro@ZenIV.linux.org.uk> - 2016-10-07 19:10 +0200
    Re: [PATCH] use a nocache copy for bvecs in copy_from_iter_nocache() "Kani, Toshimitsu" <toshi.kani@hpe.com> - 2016-10-10 19:10 +0200
      RE: [PATCH] use a nocache copy for bvecs in copy_from_iter_nocache() "Boylston, Brian" <brian.boylston@hpe.com> - 2016-10-11 16:10 +0200

csiph-web