watch_queue: Use local kmem in post_one_notification()
PATCH 1/1 watch_queue: Use local kmem in post_one_notification()
Replace the now deprecated kmem_atomic() with kmem_local_page().
Optimize for the non-highmem cases and avoid disabling preemption and pagefaults, the caller's context is atomic anyway, but that is irrelevant to kmem. The memcpy itself does not require any such semantics and the mapping would hold valid across context switches anyway. Further, highmem is planned to to be removed[1].
[1] https://lore.kernel.org/all/[email protected]/
Signed-off-by Davidlohr Bueso <[email protected]>
--- kernel/watch_queue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/watch_queue.c +2 -2
@@ -119,9 +119,9 @@ static bool post_one_notification(struct watch_queue *wqueue, offset = note %WATCH_QUEUE_NOTES_PER_PAGE *WATCH_QUEUE_NOTE_SIZE ;get_page (page); len = n->info &WATCH_INFO_LENGTH ; - p =kmap_atomic (page); + p =kmap_local_page (page);memcpy (p + offset, n, len); -kunmap_atomic (p); +kunmap_local (p); buf =pipe_buf (pipe, head); buf->page = page;
Signature · 1 line
2.39.5
Quoted 1 line · Davidlohr Bueso
Replace the now deprecated
kmem_atomic()withkmem_local_page().
heh spell checker fail.
Will send a v2 with s/kmem/kmap for the whole changelog, sorry for the noise.