linux/fs/sysv
Fabio M. De Francesco 83005276d3 fs/sysv: Replace kmap() with kmap_local_page()
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 kmap_local_page() would not break the strict rules of local mappings
(i.e., the thread locality and the stack based nesting), this function can
be easily and safely replace the deprecated API.

Therefore, replace kmap() with kmap_local_page() in fs/sysv. kunmap_local()
requires the mapping address, so return that address from dir_get_page()
to be used in dir_put_page().

Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Suggested-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>
2023-01-19 23:24:35 -05:00
..
balloc.c
dir.c fs/sysv: Replace kmap() with kmap_local_page() 2023-01-19 23:24:35 -05:00
file.c fs: make helpers idmap mount aware 2021-01-24 14:27:20 +01:00
ialloc.c
inode.c fs: allocate inode by using alloc_inode_sb() 2022-03-22 15:57:03 -07:00
itree.c fs: sysv: Fix sysv_nblocks() returns wrong value 2022-12-10 14:13:37 -05:00
Kconfig
Makefile
namei.c fs/sysv: Replace kmap() with kmap_local_page() 2023-01-19 23:24:35 -05:00
super.c fs: sysv: check sbi->s_firstdatazone in complete_read_super 2022-04-29 14:38:04 -07:00
sysv.h fs/sysv: Replace kmap() with kmap_local_page() 2023-01-19 23:24:35 -05:00