drm/i915: Replace kmap() with kmap_local_page()
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 0 repliesNew
- v1 posting 3/33 patches 3 repliesSuperseded
- v1 posting 2/31 patch 3 repliesApplied
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 posting 1/3 | 1 patch | 5 replies | Applied |
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | drm/i915: Replace kmap() with kmap_local_page()drivers/ | +4 | 0 replies | |
| 2/3 | drm/i915/gt: Replace kmap() with kmap_local_page()drivers/ drivers/ | +6 | 0 replies | |
| 3/3 | drm/i915/gem: Replace kmap() with kmap_local_page()drivers/ drivers/ | +6 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/3] drm/i915: Replace kmap() with kmap_local_page()
kmap() has been deprecated in favor of kmap_local_page().
There are two main problems with kmap(): (1) It comes with an overhead as 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).
The tasks can be preempted and, when they are scheduled to run again, the kernel virtual addresses are restored and so they are still valid.
Furthermore, kmap_local_page() is faster than kmap() in kernels with HIGHMEM enabled.
Thread locality implies that the kernel virtual addresses returned by kmap_local_page() are only valid in the context of the callers. This constraint is never violated with the conversions in this series, because the pointers are never handed to other threads, so the local mappings are allowed and preferred.
Therefore, replace kmap() with kmap_local_page() in drm/i915/, drm/i915/gem/, drm/i915/gt/.
v1->v2: Do some changes in the text of the cover letter and in the commit messages. There are no changes in the code of any of the three patches.
Fabio M. De Francesco (3):
drm/i915: Replace kmap() with kmap_local_page() drm/i915/gt: Replace kmap() with kmap_local_page() drm/i915/gem: Replace kmap() with kmap_local_page()
drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 6 ++---- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 8 ++++---- drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c | 4 ++-- drivers/gpu/drm/i915/gt/shmem_utils.c | 11 ++++------- drivers/gpu/drm/i915/i915_gem.c | 8 ++++---- 5 files changed, 16 insertions(+), 21 deletions(-)
--
2.40.0