linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ira.weiny@intel.com
To: Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Ira Weiny <ira.weiny@intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Matthew Wilcox <willy@infradead.org>,
	Christoph Hellwig <hch@infradead.org>,
	Eric Biggers <ebiggers@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH V3 0/3] Begin converting kmap calls to kmap_local_page()
Date: Thu, 10 Dec 2020 09:18:32 -0800	[thread overview]
Message-ID: <20201210171834.2472353-1-ira.weiny@intel.com> (raw)

From: Ira Weiny <ira.weiny@intel.com>

Changes from V2[1]:
	Update this cover letter
	Update commit messages
	From Matthew Wilcox
		Put functions in highmem.h rather than pagemap.h
	Investigate 0-day build errors.
		AFAICT the patches were applied to the wrong tree and caused
		build errors.

There are many places in the kernel where kmap is used for a simple memory
operation like memcpy, memset, or memmove and then the page is unmapped.

This kmap/mem*/kunmap pattern is mixed between kmap and kmap_atomic uses.  All
of them could use kmap_atomic() which is faster.  However, kmap_atomic() is
being deprecated in favor of kmap_local_page().

Use kmap_local_page() in the existing page operations.  Lift
memcpy_[to|from]_page to highmem.h.  Remove memzero_page() and use zero_user()
instead.  Add memcpy_page(), memmove_page(), and memset_page() to be used in
future patches.  Finally, add BUG_ON()s to check for any miss use of the API
and prevent data corruption in the same way zero_user() does.

This is V3 to get into 5.11 so that we can start to convert all the various
subsystems in 5.12.[2]

These are based on tip/core/mm.  I'm sending to Andrew and Thomas but I'm
expecting these to go through tip/core/mm via Thomas if that is ok with Andrew.

[1] https://lore.kernel.org/lkml/20201207225703.2033611-1-ira.weiny@intel.com/
[2] https://lore.kernel.org/lkml/20201204160504.GH1563847@iweiny-DESK2.sc.intel.com/


Ira Weiny (2):
  mm/highmem: Remove deprecated kmap_atomic
  mm/highmem: Lift memcpy_[to|from]_page to core

 include/linux/highmem.h | 81 ++++++++++++++++++++++++++++++++++-------
 lib/iov_iter.c          | 26 ++-----------
 2 files changed, 70 insertions(+), 37 deletions(-)

-- 
2.28.0.rc0.12.gb6a658bd00c9


             reply	other threads:[~2020-12-10 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 17:18 ira.weiny [this message]
2020-12-10 17:18 ` [PATCH V3 1/2] mm/highmem: Remove deprecated kmap_atomic ira.weiny
2020-12-10 17:18 ` [PATCH V3 2/2] mm/highmem: Lift memcpy_[to|from]_page to core 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=20201210171834.2472353-1-ira.weiny@intel.com \
    --to=ira.weiny@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=ebiggers@kernel.org \
    --cc=hch@infradead.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --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).