Thread (31 messages) 31 messages, 5 authors, 2025-02-17

Re: [PATCH v2 03/17] mm/rmap: convert make_device_exclusive_range() to make_device_exclusive()

From: David Hildenbrand <hidden>
Date: 2025-02-17 09:32:47
Also in: damon, dri-devel, linux-doc, linux-mm, linux-perf-users, lkml, nouveau

On 17.02.25 01:01, Alistair Popple wrote:
On Tue, Feb 11, 2025 at 09:33:54AM +0100, David Hildenbrand wrote:
quoted
On 11.02.25 06:00, Andrew Morton wrote:
quoted
On Mon, 10 Feb 2025 20:37:45 +0100 David Hildenbrand [off-list ref] wrote:
quoted
The single "real" user in the tree of make_device_exclusive_range() always
requests making only a single address exclusive. The current implementation
is hard to fix for properly supporting anonymous THP / large folios and
for avoiding messing with rmap walks in weird ways.

So let's always process a single address/page and return folio + page to
minimize page -> folio lookups. This is a preparation for further
changes.

Reject any non-anonymous or hugetlb folios early, directly after GUP.

While at it, extend the documentation of make_device_exclusive() to
clarify some things.
x86_64 allmodconfig:

drivers/gpu/drm/nouveau/nouveau_svm.c: In function 'nouveau_atomic_range_fault':
drivers/gpu/drm/nouveau/nouveau_svm.c:612:68: error: 'folio' undeclared (first use in this function)
    612 |                 page = make_device_exclusive(mm, start, drm->dev, &folio);
        |                                                                    ^~~~~
drivers/gpu/drm/nouveau/nouveau_svm.c:612:68: note: each undeclared identifier is reported only once for each function it appears in
Ah! Because I was carrying on the same branch SVM fixes [1] that are
getting surprisingly little attention so far.
I believe this has been picked up in drm-misc-fixes now:

https://lore.kernel.org/dri-devel/Z69eloo_7LM6NneO@cassiopeiae/ (local)
Yes. Both trees should merge without conflicts. However, we can later 
get rid of the now-superfluous page_folio() that was required in the drm 
fix.

-- 
Cheers,

David / dhildenb
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help