Unverified Commit c29383a8 authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Christian Brauner
Browse files

watch_queue: Use local kmap in post_one_notification()

Replace the now deprecated kmap_atomic() with kmap_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 kmap. 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: default avatarDavidlohr Bueso <dave@stgolabs.net>
Link: https://patch.msgid.link/20251118210706.1816303-1-dave@stgolabs.net


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 030e86df
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;