mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + highmem-document-kunmap_local.patch added to -mm tree
@ 2022-01-24  2:42 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2022-01-24  2:42 UTC (permalink / raw)
  To: ira.weiny, mm-commits


The patch titled
     Subject: highmem: document kunmap_local()
has been added to the -mm tree.  Its filename is
     highmem-document-kunmap_local.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/highmem-document-kunmap_local.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/highmem-document-kunmap_local.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Ira Weiny <ira.weiny@intel.com>
Subject: highmem: document kunmap_local()

Some users of kmap() add an offset to the kmap() address to be used during
the mapping.

When converting to kmap_local_page() the base address does not need to be
stored because any address within the page can be used in kunmap_local(). 
However, this was not clear from the documentation and caused some
questions.[1]

Document that any address in the page can be used in kunmap_local() to
clarify this for future users.

[1] https://lore.kernel.org/lkml/20211213154543.GM3538886@iweiny-DESK2.sc.intel.com/

Link: https://lkml.kernel.org/r/20220124013045.806718-1-ira.weiny@intel.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/highmem-internal.h |   11 +++++++++++
 1 file changed, 11 insertions(+)

--- a/include/linux/highmem-internal.h~highmem-document-kunmap_local
+++ a/include/linux/highmem-internal.h
@@ -246,6 +246,17 @@ do {								\
 	__kunmap_atomic(__addr);				\
 } while (0)
 
+/**
+ * kunmap_local - Unmap a page mapped via kmap_local_page().
+ * @__addr: An address within the page mapped
+ *
+ * __addr is often an address returned from kmap_local_page().  However,
+ * this address can be any address within the mapped page.  It does not need to
+ * be the exact address returned from kmap_local_page()
+ *
+ * Unmapping should be done in the reverse order of the mapping.  See
+ * kmap_local_page() for details.
+ */
 #define kunmap_local(__addr)					\
 do {								\
 	BUILD_BUG_ON(__same_type((__addr), struct page *));	\
_

Patches currently in -mm which might be from ira.weiny@intel.com are

highmem-document-kunmap_local.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-24  2:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24  2:42 + highmem-document-kunmap_local.patch added to -mm tree akpm

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).