diff options
| author | Fabio M. De Francesco <[email protected]> | 2022-04-13 23:55:31 +0100 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2022-07-08 17:35:42 +0100 |
| commit | ce2203e7d6de90d0d94ca3c98dde4eff3a0accd0 (patch) | |
| tree | 0262454c8152489a8fbd18d69996104a7442901c /tools/perf/scripts/python/event_analyzing_sample.py | |
| parent | aab1c42a9d77fb3f243aaab7f9f7ca14a6ffa7d2 (diff) | |
media: staging: media: atomisp: Use kmap_local_page() in hmm_store()
The use of kmap() is being deprecated in favor of kmap_local_page()
where it is feasible. The same is true for kmap_atomic().
In file pci/hmm/hmm.c, function hmm_store() test if we are in atomic
context and, if so, it calls kmap_atomic(), if not, it calls kmap().
First of all, in_atomic() shouldn't be used in drivers. This macro
cannot always detect atomic context; in particular, it cannot know
about held spinlocks in non-preemptible kernels.
Notwithstanding what it is said above, this code doesn't need to care
whether or not it is executing in atomic context. It can simply use
kmap_local_page() / kunmap_local() that can instead do the mapping /
unmapping regardless of the context.
With kmap_local_page(), the mapping is per thread, CPU local and not
globally visible. Therefore, hmm_store()() is a function where the use
of kmap_local_page() in place of both kmap() and kmap_atomic() is
correctly suited.
Convert the calls of kmap() / kunmap() and kmap_atomic() /
kunmap_atomic() to kmap_local_page() / kunmap_local() and drop the
unnecessary tests which test if the code is in atomic context.
Link: https://lore.kernel.org/linux-media/[email protected]
Signed-off-by: Fabio M. De Francesco <[email protected]>
Reviewed-by: Ira Weiny <[email protected]>
Tested-by: Hans de Goede <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions