Commit 36dd2a6e authored by Sumitra Sharma's avatar Sumitra Sharma Committed by Tvrtko Ursulin

drm/i915: 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, can 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 mapping is kept thread local in the function
“i915_vma_coredump_create” in i915_gpu_error.c

Therefore, replace kmap() with kmap_local_page().
Suggested-by: default avatarIra Weiny <ira.weiny@intel.com>
Signed-off-by: default avatarSumitra Sharma <sumitraartsy@gmail.com>
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: default avatarFabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230617180420.GA410966@sumitra.com
[tursulin: Removed blank line within tags. Fixup commit text.]
parent 6580176f
...@@ -1173,9 +1173,9 @@ i915_vma_coredump_create(const struct intel_gt *gt, ...@@ -1173,9 +1173,9 @@ i915_vma_coredump_create(const struct intel_gt *gt,
drm_clflush_pages(&page, 1); drm_clflush_pages(&page, 1);
s = kmap(page); s = kmap_local_page(page);
ret = compress_page(compress, s, dst, false); ret = compress_page(compress, s, dst, false);
kunmap(page); kunmap_local(s);
drm_clflush_pages(&page, 1); drm_clflush_pages(&page, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment