From: Davidlohr Bueso <dave@stgolabs.net>
To: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
dave@stgolabs.net
Subject: [PATCH] gpu/drm: Use local kmap in drm_clflush_page()
Date: Mon, 17 Nov 2025 07:30:57 -0800 [thread overview]
Message-ID: <20251117153057.1800631-1-dave@stgolabs.net> (raw)
Replace the now deprecated kmap_atomic() with kmap_local_page().
Optimize for the non-highmem cases and avoid disabling preemption and
pagefaults as clflushopt does not require being CPU locality guarantees
and the mapping will hold valid across context switches. 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>
---
drivers/gpu/drm/drm_cache.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
index ea1d2d5d2c66..b6a309f827f8 100644
--- a/drivers/gpu/drm/drm_cache.c
+++ b/drivers/gpu/drm/drm_cache.c
@@ -57,10 +57,10 @@ drm_clflush_page(struct page *page)
if (unlikely(page == NULL))
return;
- page_virtual = kmap_atomic(page);
+ page_virtual = kmap_local_page(page);
for (i = 0; i < PAGE_SIZE; i += size)
clflushopt(page_virtual + i);
- kunmap_atomic(page_virtual);
+ kunmap_local(page_virtual);
}
static void drm_cache_flush_clflush(struct page *pages[],
--
2.39.5
next reply other threads:[~2025-11-17 15:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 15:30 Davidlohr Bueso [this message]
2025-12-08 0:40 ` Davidlohr Bueso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251117153057.1800631-1-dave@stgolabs.net \
--to=dave@stgolabs.net \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®