]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/memory: use kmap_local_page() in __wp_page_copy_user()
authorFabio M. De Francesco <fabio.maria.de.francesco@linux.intel.com>
Mon, 20 Nov 2023 14:24:05 +0000 (15:24 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 20 Nov 2023 21:16:42 +0000 (13:16 -0800)
commita8ca22a422d23047ccf9614dce142bbfa26fea75
tree5a61399ad4c13db4d6f63baf8ad66ffcca973704
parent3080a8ae1e83e36bc33c5e20a88c258771060262
mm/memory: use kmap_local_page() in __wp_page_copy_user()

kmap_atomic() has been deprecated in favor of kmap_local_{folio,page}.

Therefore, replace kmap_atomic() with kmap_local_page in
__wp_page_copy_user().

kmap_atomic() disables preemption in !PREEMPT_RT kernels and
unconditionally disables also page-faults.  My limited knowledge of the
implementation of __wp_page_copy_user() makes me think that the latter
side effect is still needed here, but kmap_local_page() is implemented not
to disable page-faults.

So, in addition to the conversion to local mapping, add explicit
pagefault_disable() / pagefault_enable() between mapping and un-mapping.

Link: https://lkml.kernel.org/r/20231120142418.6977-1-fmdefrancesco@gmail.com
Signed-off-by: Fabio M. De Francesco <fabio.maria.de.francesco@linux.intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory.c