diff options
author | Sumitra Sharma <[email protected]> | 2023-06-10 10:57:12 -0700 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-08-18 10:18:50 -0700 |
commit | ae96e0cdc78c816b93f9617d65d144162692c09c (patch) | |
tree | f94355563a9cb7303fe1b6fb8ecc63dc41623b03 /tools/perf/scripts/python/flamegraph.py | |
parent | f58a2dd8d5d01b3ece13af7915745b8e7de20afe (diff) |
lib: replace kmap() with kmap_local_page()
kmap() has been deprecated in favor of the kmap_local_page() due to high
cost, restricted mapping space, the overhead of a global lock for
synchronization, and making the process sleep in the absence of free
slots.
kmap_local_page() is faster than kmap() and offers thread-local and
CPU-local mappings, take pagefaults in a local kmap region and preserves
preemption by saving the mappings of outgoing tasks and restoring those of
the incoming one during a context switch.
The mappings are kept thread local in the functions “dmirror_do_read”
and “dmirror_do_write” in test_hmm.c
Therefore, replace kmap() with kmap_local_page() and use
mempcy_from/to_page() to avoid open coding kmap_local_page() + memcpy() +
kunmap_local().
Remove the unused variable “tmp”.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Sumitra Sharma <[email protected]>
Suggested-by: Fabio M. De Francesco <[email protected]>
Reviewed-by: Fabio M. De Francesco <[email protected]>
Reviewed-by: Ira Weiny <[email protected]>
Cc: Deepak R Varma <[email protected]>
Cc: Jérôme Glisse <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions