mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] watch_queue: Use local kmem in post_one_notification()
@ 2025-11-18 20:55 Davidlohr Bueso
  2025-11-18 21:04 ` Davidlohr Bueso
  0 siblings, 1 reply; 2+ messages in thread
From: Davidlohr Bueso @ 2025-11-18 20:55 UTC (permalink / raw)
  To: dhowells, brauner; +Cc: linux-fsdevel, linux-kernel, dave

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/4ff89b72-03ff-4447-9d21-dd6a5fe1550f@app.fastmail.com/
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
---
 kernel/watch_queue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/watch_queue.c b/kernel/watch_queue.c
index 7e45559521af..52f89f1137da 100644
--- a/kernel/watch_queue.c
+++ b/kernel/watch_queue.c
@@ -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;
-- 
2.39.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] watch_queue: Use local kmem in post_one_notification()
  2025-11-18 20:55 [PATCH] watch_queue: Use local kmem in post_one_notification() Davidlohr Bueso
@ 2025-11-18 21:04 ` Davidlohr Bueso
  0 siblings, 0 replies; 2+ messages in thread
From: Davidlohr Bueso @ 2025-11-18 21:04 UTC (permalink / raw)
  To: dhowells, brauner; +Cc: linux-fsdevel, linux-kernel

On Tue, 18 Nov 2025, Davidlohr Bueso wrote:

>Replace the now deprecated kmem_atomic() with kmem_local_page().

heh spell checker fail.

Will send a v2 with s/kmem/kmap for the whole changelog, sorry for the noise.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-18 21:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-18 20:55 [PATCH] watch_queue: Use local kmem in post_one_notification() Davidlohr Bueso
2025-11-18 21:04 ` Davidlohr Bueso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®