aboutsummaryrefslogtreecommitdiff
path: root/fs/dlm/lvb_table.h
diff options
context:
space:
mode:
authorFabio M. De Francesco2023-01-09 19:28:43 +0100
committerAl Viro2023-01-10 21:24:56 -0500
commitf27c942e3e3e80475cc463b5fc373f280d85b926 (patch)
tree0d9a4ecb035a29fd40b80453a39a52fe5b0241eb /fs/dlm/lvb_table.h
parentb7bfaa761d760e72a969d116517eaa12e404c262 (diff)
fs/cramfs: Convert kmap() to kmap_local_data()
The use of kmap() is being deprecated in favor of kmap_local_page(). There are two main problems with kmap(): (1) It comes with an overhead as the mapping space is restricted and protected by a global lock for synchronization and (2) it also requires global TLB invalidation when the kmap’s pool wraps and it might block when the mapping space is fully utilized until a slot becomes available. With kmap_local_page() the mappings are per thread, CPU local, can take page faults, and can be called from any context (including interrupts). It is faster than kmap() in kernels with HIGHMEM enabled. Furthermore, the tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and still valid. Since its use in fs/cramfs is safe everywhere, it should be preferred. Therefore, replace kmap() with kmap_local_page() in fs/cramfs. Instead of open-coding kmap_local_page() + memcpy(), use memcpy_from_page(). Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: "Venkataramanan, Anirudh" <anirudh.venkataramanan@intel.com> Suggested-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Nicolas Pitre <nico@fluxnic.net> Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dlm/lvb_table.h')
0 files changed, 0 insertions, 0 deletions