linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: "ira.weiny@intel.com" <ira.weiny@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Sterba <dsterba@suse.cz>
Cc: Boris Pismenny <borisp@mellanox.com>,
	Or Gerlitz <gerlitz.or@gmail.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Matthew Wilcox <willy@infradead.org>,
	"hch@infradead.org" <hch@infradead.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Eric Biggers <ebiggers@kernel.org>, "clm@fb.com" <clm@fb.com>,
	"josef@toxicpanda.com" <josef@toxicpanda.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH V2 1/8] mm/highmem: Lift memcpy_[to|from]_page to core
Date: Wed, 10 Feb 2021 06:33:24 +0000	[thread overview]
Message-ID: <BYAPR04MB49655E6A3BD935B15DCC468B868D9@BYAPR04MB4965.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20210210062221.3023586-2-ira.weiny@intel.com

On 2/9/21 22:25, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
>
> Working through a conversion to a call kmap_local_page() instead of
> kmap() revealed many places where the pattern kmap/memcpy/kunmap
> occurred.
>
> Eric Biggers, Matthew Wilcox, Christoph Hellwig, Dan Williams, and Al
> Viro all suggested putting this code into helper functions.  Al Viro
> further pointed out that these functions already existed in the iov_iter
> code.[1]
>
> Various locations for the lifted functions were considered.
>
> Headers like mm.h or string.h seem ok but don't really portray the
> functionality well.  pagemap.h made some sense but is for page cache
> functionality.[2]
>
> Another alternative would be to create a new header for the promoted
> memcpy functions, but it masks the fact that these are designed to copy
> to/from pages using the kernel direct mappings and complicates matters
> with a new header.
>
> Placing these functions in 'highmem.h' is suboptimal especially with the
> changes being proposed in the functionality of kmap.  From a caller
> perspective including/using 'highmem.h' implies that the functions
> defined in that header are only required when highmem is in use which is
> increasingly not the case with modern processors.  However, highmem.h is
> where all the current functions like this reside (zero_user(),
> clear_highpage(), clear_user_highpage(), copy_user_highpage(), and
> copy_highpage()).  So it makes the most sense even though it is
> distasteful for some.[3]
>
> Lift memcpy_to_page() and memcpy_from_page() to pagemap.h.
>
> [1] https://lore.kernel.org/lkml/20201013200149.GI3576660@ZenIV.linux.org.uk/
>     https://lore.kernel.org/lkml/20201013112544.GA5249@infradead.org/
>
> [2] https://lore.kernel.org/lkml/20201208122316.GH7338@casper.infradead.org/
>
> [3] https://lore.kernel.org/lkml/20201013200149.GI3576660@ZenIV.linux.org.uk/#t
>     https://lore.kernel.org/lkml/20201208163814.GN1563847@iweiny-DESK2.sc.intel.com/
>
> Cc: Boris Pismenny <borisp@mellanox.com>
> Cc: Or Gerlitz <gerlitz.or@gmail.com>
> Cc: Dave Hansen <dave.hansen@intel.com>
> Suggested-by: Matthew Wilcox <willy@infradead.org>
> Suggested-by: Christoph Hellwig <hch@infradead.org>
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
> Suggested-by: Eric Biggers <ebiggers@kernel.org>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Thanks for adding a new line in the new calls after variable declaration.
Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>


  reply	other threads:[~2021-02-10  6:35 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  6:22 [PATCH V2 0/8] btrfs: convert kmaps to core page calls ira.weiny
2021-02-10  6:22 ` [PATCH V2 1/8] mm/highmem: Lift memcpy_[to|from]_page to core ira.weiny
2021-02-10  6:33   ` Chaitanya Kulkarni [this message]
2021-02-10 12:53   ` Christoph Hellwig
2021-02-10  6:22 ` [PATCH V2 2/8] mm/highmem: Convert memcpy_[to|from]_page() to kmap_local_page() ira.weiny
2021-02-10  6:37   ` Chaitanya Kulkarni
2021-02-10 12:54   ` Christoph Hellwig
2021-02-10  6:22 ` [PATCH V2 3/8] mm/highmem: Introduce memcpy_page(), memmove_page(), and memset_page() ira.weiny
2021-02-10  6:46   ` Chaitanya Kulkarni
2021-02-10 12:54   ` Christoph Hellwig
2021-02-10  6:22 ` [PATCH V2 4/8] mm/highmem: Add VM_BUG_ON() to mem*_page() calls ira.weiny
2021-02-10  6:57   ` Chaitanya Kulkarni
2021-02-10 16:31     ` Ira Weiny
2021-02-10 12:55   ` Christoph Hellwig
2021-02-10 16:29     ` Ira Weiny
2021-02-10 16:41       ` Christoph Hellwig
2021-02-10 17:04         ` Ira Weiny
2021-02-10 18:56       ` Matthew Wilcox
2021-02-10 21:22         ` Ira Weiny
2021-02-11 18:52           ` David Sterba
2021-02-10 17:49   ` [PATCH V2.1] " ira.weiny
2021-02-10  6:22 ` [PATCH V2 5/8] iov_iter: Remove memzero_page() in favor of zero_user() ira.weiny
2021-02-10 12:55   ` Christoph Hellwig
2021-02-10  6:22 ` [PATCH V2 6/8] btrfs: use memcpy_[to|from]_page() and kmap_local_page() ira.weiny
2021-02-10 12:56   ` Christoph Hellwig
2021-02-10  6:22 ` [PATCH V2 7/8] btrfs: use copy_highpage() instead of 2 kmaps() ira.weiny
2021-02-10 12:56   ` Christoph Hellwig
2021-02-10  6:22 ` [PATCH V2 8/8] btrfs: convert to zero_user() ira.weiny
2021-02-10 12:57   ` Christoph Hellwig
2021-02-11 19:38 ` [PATCH V2 0/8] btrfs: convert kmaps to core page calls David Sterba
2021-02-11 21:32   ` Ira Weiny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR04MB49655E6A3BD935B15DCC468B868D9@BYAPR04MB4965.namprd04.prod.outlook.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=akpm@linux-foundation.org \
    --cc=borisp@mellanox.com \
    --cc=clm@fb.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dsterba@suse.cz \
    --cc=ebiggers@kernel.org \
    --cc=gerlitz.or@gmail.com \
    --cc=hch@infradead.org \
    --cc=ira.weiny@intel.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).