* [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts
@ 2026-07-14 22:21 Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 1/4] fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support Stanislav Kinsburskii
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2026-07-14 22:21 UTC (permalink / raw)
To: airlied, akhilesh, akpm, corbet, dakr, david, jgg, kees, leon,
liam, lizhi.hou, ljs, lyude, maarten.lankhorst, mamin506, mhocko,
mripard, nouveau, ogabbay, oleg, rppt, shuah, simona, skhan,
skinsburskii, surenb, tzimmermann, vbabka
Cc: dri-devel, linux-mm, linux-doc, linux-kernel, linux-kselftest,
linux-rdma
This small fixup series applies on top of:
[PATCH v8 0/8] mm/hmm: Add mmap lock-drop support for userfaultfd-backed mappings
The first patch updates the HMM documentation example to make the
mmu_interval_read_retry() state explicit: callers should use the notifier and
notifier_seq stored in the same hmm_range that was passed to
hmm_range_fault_unlocked_timeout().
The remaining patches adjust nouveau, amdxdna, and drm_gpusvm users so the
timeout passed to hmm_range_fault_unlocked_timeout() is treated as a relative
HMM retry budget. These callers no longer keep an absolute deadline around
their outer driver retry loops or pass a computed remaining time into HMM.
This keeps the timeout scoped to HMM's internal mmu-notifier retry handling. If
HMM succeeds and the driver later observes an invalidation through
mmu_interval_read_retry(), the driver retries the operation with a fresh HMM
retry budget.
Changes in v2:
- Kept the nouveau outer absolute timeout around the
mmu_interval_read_retry() loop. hmm_range_fault_unlocked_timeout() only
bounds HMM’s internal retries, while nouveau faults are handled from a GPU
fault worker, so userspace fatal signals cannot break an endless stream of
invalidations there.
- Updated nouveau to use time_after_eq() before calling HMM, so the remaining
timeout passed to hmm_range_fault_unlocked_timeout() is always positive and
never 0, which would mean retry indefinitely.
- Updated the nouveau fixup commit message to explain the worker-thread
timeout issue and the time_after_eq() boundary behavior.
- Fixed the amdxdna fixup commit message. It now describes
aie2_populate_range() correctly instead of carrying stale nouveau prose,
and notes that command submission still keeps its broader timeout while HMM
gets a fresh relative retry budget.
---
Stanislav Kinsburskii (4):
fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support
fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults
fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population
fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults
Documentation/mm/hmm.rst | 5 +++--
drivers/accel/amdxdna/aie2_ctx.c | 12 ++++--------
drivers/gpu/drm/drm_gpusvm.c | 21 ++++++---------------
drivers/gpu/drm/nouveau/nouveau_svm.c | 14 ++++++++++----
4 files changed, 23 insertions(+), 29 deletions(-)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 1/4] fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support
2026-07-14 22:21 [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts Stanislav Kinsburskii
@ 2026-07-14 22:21 ` Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 2/4] fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults Stanislav Kinsburskii
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2026-07-14 22:21 UTC (permalink / raw)
To: airlied, akhilesh, akpm, corbet, dakr, david, jgg, kees, leon,
liam, lizhi.hou, ljs, lyude, maarten.lankhorst, mamin506, mhocko,
mripard, nouveau, ogabbay, oleg, rppt, shuah, simona, skhan,
skinsburskii, surenb, tzimmermann, vbabka
Cc: dri-devel, linux-mm, linux-doc, linux-kernel, linux-kselftest,
linux-rdma
The hmm_range_fault_unlocked_timeout() example checks for a concurrent
mmu_interval_notifier invalidation after the HMM fault has succeeded.
The sequence number used for that check is stored in range->notifier_seq
by hmm_range_fault_unlocked_timeout(), so the retry check should use the
same notifier stored in range as well.
Update the example to pass range.notifier to mmu_interval_read_retry(),
and spell out that the retry check uses the notifier and sequence number
stored in range by the HMM fault helper. This makes the relationship
between the HMM walk and the later invalidation check explicit.
Signed-off-by: Stanislav Kinsburskii <skinsburskii@gmail.com>
---
Documentation/mm/hmm.rst | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/mm/hmm.rst b/Documentation/mm/hmm.rst
index 5c88d2cf0818..fc1b8dc19825 100644
--- a/Documentation/mm/hmm.rst
+++ b/Documentation/mm/hmm.rst
@@ -206,7 +206,7 @@ The usage pattern is::
goto out_put;
take_lock(driver->update);
- if (mmu_interval_read_retry(&interval_sub, range.notifier_seq)) {
+ if (mmu_interval_read_retry(range.notifier, range.notifier_seq)) {
release_lock(driver->update);
goto again;
}
@@ -225,7 +225,8 @@ The usage pattern is::
The driver->update lock is the same lock that the driver takes inside its
invalidate() callback. That lock must be held before calling
mmu_interval_read_retry() to avoid any race with a concurrent CPU page table
-update.
+update. The retry check must use the same notifier and sequence number stored
+in ``range`` by ``hmm_range_fault_unlocked_timeout()``.
Holding the mmap lock across HMM faults
=======================================
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 2/4] fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults
2026-07-14 22:21 [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 1/4] fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support Stanislav Kinsburskii
@ 2026-07-14 22:21 ` Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 3/4] fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population Stanislav Kinsburskii
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2026-07-14 22:21 UTC (permalink / raw)
To: airlied, akhilesh, akpm, corbet, dakr, david, jgg, kees, leon,
liam, lizhi.hou, ljs, lyude, maarten.lankhorst, mamin506, mhocko,
mripard, nouveau, ogabbay, oleg, rppt, shuah, simona, skhan,
skinsburskii, surenb, tzimmermann, vbabka
Cc: dri-devel, linux-mm, linux-doc, linux-kernel, linux-kselftest,
linux-rdma
nouveau_range_fault() now uses hmm_range_fault_unlocked_timeout() for
the HMM fault path. Pass the remaining SVM fault timeout into HMM as a
positive relative timeout instead of open-coding the HMM retry loop in
nouveau.
Keep the outer absolute timeout around nouveau's
mmu_interval_read_retry() loop. HMM's timeout only bounds retries while
HMM is walking and faulting the range. Once HMM returns successfully, a
continuous stream of mmu-notifier invalidations can still make
mmu_interval_read_retry() restart the operation. This path runs from the
GPU fault worker, so fatal signals for the faulting userspace task cannot
be relied on to break that outer loop.
Use time_after_eq() before the HMM call so the remaining timeout passed
to HMM is always positive. This preserves the old timeout behavior at the
expiry boundary and avoids passing 0, which means retry indefinitely, to
hmm_range_fault_unlocked_timeout().
Signed-off-by: Stanislav Kinsburskii <skinsburskii@gmail.com>
---
drivers/gpu/drm/nouveau/nouveau_svm.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c
index 4cfb6eb7c771..58735446d783 100644
--- a/drivers/gpu/drm/nouveau/nouveau_svm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_svm.c
@@ -678,14 +678,20 @@ static int nouveau_range_fault(struct nouveau_svmm *svmm,
range.end = notifier->notifier.interval_tree.last + 1;
while (true) {
- if (time_after(jiffies, timeout)) {
+ long remaining = timeout - jiffies;
+
+ /*
+ * The HMM timeout only bounds retries while HMM is walking and
+ * faulting the range. This fault is handled by a kernel worker,
+ * so fatal signals from the faulting process cannot stop an
+ * endless stream of invalidations here.
+ */
+ if (time_after_eq(jiffies, timeout)) {
ret = -EBUSY;
goto out;
}
- ret = hmm_range_fault_unlocked_timeout(&range,
- max(timeout - jiffies,
- 1L));
+ ret = hmm_range_fault_unlocked_timeout(&range, remaining);
if (ret)
goto out;
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 3/4] fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population
2026-07-14 22:21 [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 1/4] fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 2/4] fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults Stanislav Kinsburskii
@ 2026-07-14 22:21 ` Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 4/4] fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults Stanislav Kinsburskii
2026-07-15 12:41 ` [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts David Hildenbrand (Arm)
4 siblings, 0 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2026-07-14 22:21 UTC (permalink / raw)
To: airlied, akhilesh, akpm, corbet, dakr, david, jgg, kees, leon,
liam, lizhi.hou, ljs, lyude, maarten.lankhorst, mamin506, mhocko,
mripard, nouveau, ogabbay, oleg, rppt, shuah, simona, skhan,
skinsburskii, surenb, tzimmermann, vbabka
Cc: dri-devel, linux-mm, linux-doc, linux-kernel, linux-kselftest,
linux-rdma
aie2_populate_range() now uses hmm_range_fault_unlocked_timeout() to let
HMM own mmap_lock acquisition and retry handling while populating an
invalid user mapping. The timeout passed to that helper is a relative
HMM retry budget, not an absolute deadline.
Pass HMM_RANGE_DEFAULT_TIMEOUT directly to the HMM helper instead of
computing the remaining time from a local absolute deadline. The broader
command submission path still keeps its existing timeout around repeated
range population attempts, while each HMM fault attempt receives a fresh
retry budget for HMM's internal mmu-notifier retries.
Keep the existing driver-visible timeout errno by translating -EBUSY
from hmm_range_fault_unlocked_timeout() to -ETIME on return.
Signed-off-by: Stanislav Kinsburskii <skinsburskii@gmail.com>
---
drivers/accel/amdxdna/aie2_ctx.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
index 548ba4315554..21f2817751f9 100644
--- a/drivers/accel/amdxdna/aie2_ctx.c
+++ b/drivers/accel/amdxdna/aie2_ctx.c
@@ -1037,7 +1037,7 @@ static int aie2_populate_range(struct amdxdna_gem_obj *abo)
bool found;
int ret;
- timeout = jiffies + msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
+ timeout = msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
again:
found = false;
down_write(&xdna->notifier_lock);
@@ -1062,13 +1062,9 @@ static int aie2_populate_range(struct amdxdna_gem_obj *abo)
return -EFAULT;
}
- ret = hmm_range_fault_unlocked_timeout(&mapp->range,
- max_t(long, timeout - jiffies, 1));
- if (ret) {
- if (ret == -EBUSY)
- ret = -ETIME;
+ ret = hmm_range_fault_unlocked_timeout(&mapp->range, timeout);
+ if (ret)
goto put_mm;
- }
down_write(&xdna->notifier_lock);
if (mmu_interval_read_retry(&mapp->notifier, mapp->range.notifier_seq)) {
@@ -1086,7 +1082,7 @@ static int aie2_populate_range(struct amdxdna_gem_obj *abo)
put_mm:
amdxdna_umap_put(mapp);
mmput(mm);
- return ret;
+ return ret == -EBUSY ? -ETIME : ret;
}
int aie2_cmd_submit(struct amdxdna_hwctx *hwctx, struct amdxdna_sched_job *job, u64 *seq)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 4/4] fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults
2026-07-14 22:21 [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts Stanislav Kinsburskii
` (2 preceding siblings ...)
2026-07-14 22:21 ` [PATCH v2 3/4] fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population Stanislav Kinsburskii
@ 2026-07-14 22:21 ` Stanislav Kinsburskii
2026-07-15 12:41 ` [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts David Hildenbrand (Arm)
4 siblings, 0 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2026-07-14 22:21 UTC (permalink / raw)
To: airlied, akhilesh, akpm, corbet, dakr, david, jgg, kees, leon,
liam, lizhi.hou, ljs, lyude, maarten.lankhorst, mamin506, mhocko,
mripard, nouveau, ogabbay, oleg, rppt, shuah, simona, skhan,
skinsburskii, surenb, tzimmermann, vbabka
Cc: dri-devel, linux-mm, linux-doc, linux-kernel, linux-kselftest,
linux-rdma
The timeout passed to hmm_range_fault_unlocked_timeout() is a relative
retry budget for HMM's internal mmu-notifier retry loop. drm_gpusvm was
still keeping an absolute deadline around the outer driver retry logic
and passing the remaining time into HMM.
Pass HMM_RANGE_DEFAULT_TIMEOUT directly to
hmm_range_fault_unlocked_timeout() on each HMM fault attempt instead.
If HMM succeeds but the later drm_gpusvm-side mmu_interval_read_retry()
check observes an invalidation, retry with a fresh HMM retry budget.
This keeps the timeout focused on repeated notifier retries inside HMM,
while avoiding an outer deadline that also accounts unrelated driver-side
work after HMM has made progress.
Signed-off-by: Stanislav Kinsburskii <skinsburskii@gmail.com>
---
drivers/gpu/drm/drm_gpusvm.c | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c
index b8f2dd9982f5..76e8a0028c7f 100644
--- a/drivers/gpu/drm/drm_gpusvm.c
+++ b/drivers/gpu/drm/drm_gpusvm.c
@@ -852,8 +852,7 @@ enum drm_gpusvm_scan_result drm_gpusvm_scan_mm(struct drm_gpusvm_range *range,
.end = end,
.dev_private_owner = dev_private_owner,
};
- unsigned long timeout =
- jiffies + msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
+ unsigned long timeout = msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
enum drm_gpusvm_scan_result state = DRM_GPUSVM_SCAN_UNPOPULATED, new_state;
unsigned long *pfns;
unsigned long npages = npages_in_range(start, end);
@@ -867,8 +866,7 @@ enum drm_gpusvm_scan_result drm_gpusvm_scan_mm(struct drm_gpusvm_range *range,
hmm_range.hmm_pfns = pfns;
retry:
- err = hmm_range_fault_unlocked_timeout(&hmm_range,
- max(timeout - jiffies, 1L));
+ err = hmm_range_fault_unlocked_timeout(&hmm_range, timeout);
if (err)
goto err_free;
@@ -1459,8 +1457,7 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
.dev_private_owner = ctx->device_private_page_owner,
};
void *zdd;
- unsigned long timeout =
- jiffies + msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
+ unsigned long timeout = msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
unsigned long i, j;
unsigned long npages = npages_in_range(pages_start, pages_end);
unsigned long num_dma_mapped;
@@ -1478,9 +1475,6 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
return -EINVAL;
retry:
- if (time_after(jiffies, timeout))
- return -EBUSY;
-
hmm_range.notifier_seq = mmu_interval_read_begin(notifier);
if (drm_gpusvm_pages_valid_unlocked(gpusvm, svm_pages))
goto set_seqno;
@@ -1495,8 +1489,7 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
}
hmm_range.hmm_pfns = pfns;
- err = hmm_range_fault_unlocked_timeout(&hmm_range,
- max_t(long, timeout - jiffies, 1));
+ err = hmm_range_fault_unlocked_timeout(&hmm_range, timeout);
mmput(mm);
if (err)
goto err_free;
@@ -1718,8 +1711,7 @@ int drm_gpusvm_range_evict(struct drm_gpusvm *gpusvm,
.end = drm_gpusvm_range_end(range),
.dev_private_owner = NULL,
};
- unsigned long timeout =
- jiffies + msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
+ unsigned long timeout = msecs_to_jiffies(HMM_RANGE_DEFAULT_TIMEOUT);
unsigned long *pfns;
unsigned long npages = npages_in_range(drm_gpusvm_range_start(range),
drm_gpusvm_range_end(range));
@@ -1734,8 +1726,7 @@ int drm_gpusvm_range_evict(struct drm_gpusvm *gpusvm,
return -ENOMEM;
hmm_range.hmm_pfns = pfns;
- err = hmm_range_fault_unlocked_timeout(&hmm_range,
- max_t(long, timeout - jiffies, 1));
+ err = hmm_range_fault_unlocked_timeout(&hmm_range, timeout);
kvfree(pfns);
mmput(mm);
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts
2026-07-14 22:21 [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts Stanislav Kinsburskii
` (3 preceding siblings ...)
2026-07-14 22:21 ` [PATCH v2 4/4] fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults Stanislav Kinsburskii
@ 2026-07-15 12:41 ` David Hildenbrand (Arm)
2026-07-15 14:42 ` Stanislav Kinsburskii
4 siblings, 1 reply; 12+ messages in thread
From: David Hildenbrand (Arm) @ 2026-07-15 12:41 UTC (permalink / raw)
To: Stanislav Kinsburskii, airlied, akhilesh, akpm, corbet, dakr, jgg,
kees, leon, liam, lizhi.hou, ljs, lyude, maarten.lankhorst,
mamin506, mhocko, mripard, nouveau, ogabbay, oleg, rppt, shuah,
simona, skhan, surenb, tzimmermann, vbabka
Cc: dri-devel, linux-mm, linux-doc, linux-kernel, linux-kselftest,
linux-rdma
On 7/15/26 00:21, Stanislav Kinsburskii wrote:
> This small fixup series applies on top of:
>
> [PATCH v8 0/8] mm/hmm: Add mmap lock-drop support for userfaultfd-backed mappings
>
> The first patch updates the HMM documentation example to make the
> mmu_interval_read_retry() state explicit: callers should use the notifier and
> notifier_seq stored in the same hmm_range that was passed to
> hmm_range_fault_unlocked_timeout().
>
> The remaining patches adjust nouveau, amdxdna, and drm_gpusvm users so the
> timeout passed to hmm_range_fault_unlocked_timeout() is treated as a relative
> HMM retry budget. These callers no longer keep an absolute deadline around
> their outer driver retry loops or pass a computed remaining time into HMM.
>
> This keeps the timeout scoped to HMM's internal mmu-notifier retry handling. If
> HMM succeeds and the driver later observes an invalidation through
> mmu_interval_read_retry(), the driver retries the operation with a fresh HMM
> retry budget.
>
> Changes in v2:
> - Kept the nouveau outer absolute timeout around the
> mmu_interval_read_retry() loop. hmm_range_fault_unlocked_timeout() only
> bounds HMM’s internal retries, while nouveau faults are handled from a GPU
> fault worker, so userspace fatal signals cannot break an endless stream of
> invalidations there.
> - Updated nouveau to use time_after_eq() before calling HMM, so the remaining
> timeout passed to hmm_range_fault_unlocked_timeout() is always positive and
> never 0, which would mean retry indefinitely.
> - Updated the nouveau fixup commit message to explain the worker-thread
> timeout issue and the time_after_eq() boundary behavior.
> - Fixed the amdxdna fixup commit message. It now describes
> aie2_populate_range() correctly instead of carrying stale nouveau prose,
> and notes that command submission still keeps its broader timeout while HMM
> gets a fresh relative retry budget.
>
>
> ---
>
> Stanislav Kinsburskii (4):
> fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support
> fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults
> fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population
> fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults
Why a fixup series instead of properly resending the full thing?
--
Cheers,
David
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts
2026-07-15 12:41 ` [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts David Hildenbrand (Arm)
@ 2026-07-15 14:42 ` Stanislav Kinsburskii
2026-07-15 15:02 ` Jason Gunthorpe
2026-07-15 16:02 ` Lorenzo Stoakes (ARM)
0 siblings, 2 replies; 12+ messages in thread
From: Stanislav Kinsburskii @ 2026-07-15 14:42 UTC (permalink / raw)
To: David Hildenbrand (Arm)
Cc: airlied, akhilesh, akpm, corbet, dakr, jgg, kees, leon, liam,
lizhi.hou, ljs, lyude, maarten.lankhorst, mamin506, mhocko,
mripard, nouveau, ogabbay, oleg, rppt, shuah, simona, skhan,
surenb, tzimmermann, vbabka, dri-devel, linux-mm, linux-doc,
linux-kernel, linux-kselftest, linux-rdma
On Wed, Jul 15, 2026 at 02:41:43PM +0200, David Hildenbrand (Arm) wrote:
> On 7/15/26 00:21, Stanislav Kinsburskii wrote:
> > This small fixup series applies on top of:
> >
> > [PATCH v8 0/8] mm/hmm: Add mmap lock-drop support for userfaultfd-backed mappings
> >
> > The first patch updates the HMM documentation example to make the
> > mmu_interval_read_retry() state explicit: callers should use the notifier and
> > notifier_seq stored in the same hmm_range that was passed to
> > hmm_range_fault_unlocked_timeout().
> >
> > The remaining patches adjust nouveau, amdxdna, and drm_gpusvm users so the
> > timeout passed to hmm_range_fault_unlocked_timeout() is treated as a relative
> > HMM retry budget. These callers no longer keep an absolute deadline around
> > their outer driver retry loops or pass a computed remaining time into HMM.
> >
> > This keeps the timeout scoped to HMM's internal mmu-notifier retry handling. If
> > HMM succeeds and the driver later observes an invalidation through
> > mmu_interval_read_retry(), the driver retries the operation with a fresh HMM
> > retry budget.
> >
> > Changes in v2:
> > - Kept the nouveau outer absolute timeout around the
> > mmu_interval_read_retry() loop. hmm_range_fault_unlocked_timeout() only
> > bounds HMM’s internal retries, while nouveau faults are handled from a GPU
> > fault worker, so userspace fatal signals cannot break an endless stream of
> > invalidations there.
> > - Updated nouveau to use time_after_eq() before calling HMM, so the remaining
> > timeout passed to hmm_range_fault_unlocked_timeout() is always positive and
> > never 0, which would mean retry indefinitely.
> > - Updated the nouveau fixup commit message to explain the worker-thread
> > timeout issue and the time_after_eq() boundary behavior.
> > - Fixed the amdxdna fixup commit message. It now describes
> > aie2_populate_range() correctly instead of carrying stale nouveau prose,
> > and notes that command submission still keeps its broader timeout while HMM
> > gets a fresh relative retry budget.
> >
> >
> > ---
> >
> > Stanislav Kinsburskii (4):
> > fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support
> > fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults
> > fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population
> > fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults
>
> Why a fixup series instead of properly resending the full thing?
>
The goal was to get a Sashiko review, and v8 has already been applied to
both `mm-new` and `linux-next`.
You can find more details here:
https://sashiko.dev/#/message/alaWmUEeIBeSkmO0%40skinsburskii
Thanks, Stanislav
> --
> Cheers,
>
> David
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts
2026-07-15 14:42 ` Stanislav Kinsburskii
@ 2026-07-15 15:02 ` Jason Gunthorpe
2026-07-15 16:03 ` Lorenzo Stoakes (ARM)
2026-07-15 16:02 ` Lorenzo Stoakes (ARM)
1 sibling, 1 reply; 12+ messages in thread
From: Jason Gunthorpe @ 2026-07-15 15:02 UTC (permalink / raw)
To: Stanislav Kinsburskii
Cc: David Hildenbrand (Arm), airlied, akhilesh, akpm, corbet, dakr,
kees, leon, liam, lizhi.hou, ljs, lyude, maarten.lankhorst,
mamin506, mhocko, mripard, nouveau, ogabbay, oleg, rppt, shuah,
simona, skhan, surenb, tzimmermann, vbabka, dri-devel, linux-mm,
linux-doc, linux-kernel, linux-kselftest, linux-rdma
On Wed, Jul 15, 2026 at 07:42:48AM -0700, Stanislav Kinsburskii wrote:
> > > Stanislav Kinsburskii (4):
> > > fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support
> > > fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults
> > > fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population
> > > fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults
> >
> > Why a fixup series instead of properly resending the full thing?
> >
>
> The goal was to get a Sashiko review, and v8 has already been applied to
> both `mm-new` and `linux-next`.
I think if you send the whole thing with a base-commit tag that
specifies a real base commit in linux-next sashiko should work
Jason
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts
2026-07-15 14:42 ` Stanislav Kinsburskii
2026-07-15 15:02 ` Jason Gunthorpe
@ 2026-07-15 16:02 ` Lorenzo Stoakes (ARM)
2026-07-15 16:39 ` Stanislav Kinsburskii
1 sibling, 1 reply; 12+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-07-15 16:02 UTC (permalink / raw)
To: Stanislav Kinsburskii
Cc: David Hildenbrand (Arm), airlied, akhilesh, akpm, corbet, dakr,
jgg, kees, leon, liam, lizhi.hou, lyude, maarten.lankhorst,
mamin506, mhocko, mripard, nouveau, ogabbay, oleg, rppt, shuah,
simona, skhan, surenb, tzimmermann, vbabka, dri-devel, linux-mm,
linux-doc, linux-kernel, linux-kselftest, linux-rdma
To avoid confusion: obviously please don't merge this series Andrew.
On Wed, Jul 15, 2026 at 07:42:48AM -0700, Stanislav Kinsburskii wrote:
> On Wed, Jul 15, 2026 at 02:41:43PM +0200, David Hildenbrand (Arm) wrote:
> > On 7/15/26 00:21, Stanislav Kinsburskii wrote:
> > > This small fixup series applies on top of:
> > >
> > > [PATCH v8 0/8] mm/hmm: Add mmap lock-drop support for userfaultfd-backed mappings
> > >
> > > The first patch updates the HMM documentation example to make the
> > > mmu_interval_read_retry() state explicit: callers should use the notifier and
> > > notifier_seq stored in the same hmm_range that was passed to
> > > hmm_range_fault_unlocked_timeout().
> > >
> > > The remaining patches adjust nouveau, amdxdna, and drm_gpusvm users so the
> > > timeout passed to hmm_range_fault_unlocked_timeout() is treated as a relative
> > > HMM retry budget. These callers no longer keep an absolute deadline around
> > > their outer driver retry loops or pass a computed remaining time into HMM.
> > >
> > > This keeps the timeout scoped to HMM's internal mmu-notifier retry handling. If
> > > HMM succeeds and the driver later observes an invalidation through
> > > mmu_interval_read_retry(), the driver retries the operation with a fresh HMM
> > > retry budget.
> > >
> > > Changes in v2:
> > > - Kept the nouveau outer absolute timeout around the
> > > mmu_interval_read_retry() loop. hmm_range_fault_unlocked_timeout() only
> > > bounds HMM’s internal retries, while nouveau faults are handled from a GPU
> > > fault worker, so userspace fatal signals cannot break an endless stream of
> > > invalidations there.
> > > - Updated nouveau to use time_after_eq() before calling HMM, so the remaining
> > > timeout passed to hmm_range_fault_unlocked_timeout() is always positive and
> > > never 0, which would mean retry indefinitely.
> > > - Updated the nouveau fixup commit message to explain the worker-thread
> > > timeout issue and the time_after_eq() boundary behavior.
> > > - Fixed the amdxdna fixup commit message. It now describes
> > > aie2_populate_range() correctly instead of carrying stale nouveau prose,
> > > and notes that command submission still keeps its broader timeout while HMM
> > > gets a fresh relative retry budget.
> > >
> > >
> > > ---
> > >
> > > Stanislav Kinsburskii (4):
> > > fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support
> > > fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults
> > > fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population
> > > fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults
> >
> > Why a fixup series instead of properly resending the full thing?
> >
>
> The goal was to get a Sashiko review, and v8 has already been applied to
> both `mm-new` and `linux-next`.
Please don't do this, this is completely impossible to track for review :)
mm review is currently very difficult based on volumes, it'll become impossible
to manage if people sound fragments of series.
Please just resend the whole thing at this point.
>
> You can find more details here:
>
> https://sashiko.dev/#/message/alaWmUEeIBeSkmO0%40skinsburskii
>
> Thanks, Stanislav
>
> > --
> > Cheers,
> >
> > David
Thanks, Lorenzo
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts
2026-07-15 15:02 ` Jason Gunthorpe
@ 2026-07-15 16:03 ` Lorenzo Stoakes (ARM)
0 siblings, 0 replies; 12+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-07-15 16:03 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Stanislav Kinsburskii, David Hildenbrand (Arm), airlied, akhilesh,
akpm, corbet, dakr, kees, leon, liam, lizhi.hou, lyude,
maarten.lankhorst, mamin506, mhocko, mripard, nouveau, ogabbay,
oleg, rppt, shuah, simona, skhan, surenb, tzimmermann, vbabka,
dri-devel, linux-mm, linux-doc, linux-kernel, linux-kselftest,
linux-rdma
On Wed, Jul 15, 2026 at 12:02:10PM -0300, Jason Gunthorpe wrote:
> On Wed, Jul 15, 2026 at 07:42:48AM -0700, Stanislav Kinsburskii wrote:
>
> > > > Stanislav Kinsburskii (4):
> > > > fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support
> > > > fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults
> > > > fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population
> > > > fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults
> > >
> > > Why a fixup series instead of properly resending the full thing?
> > >
> >
> > The goal was to get a Sashiko review, and v8 has already been applied to
> > both `mm-new` and `linux-next`.
>
> I think if you send the whole thing with a base-commit tag that
> specifies a real base commit in linux-next sashiko should work
>
> Jason
Oh so just use b4 then :)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts
2026-07-15 16:02 ` Lorenzo Stoakes (ARM)
@ 2026-07-15 16:39 ` Stanislav Kinsburskii
2026-07-15 17:14 ` Andrew Morton
0 siblings, 1 reply; 12+ messages in thread
From: Stanislav Kinsburskii @ 2026-07-15 16:39 UTC (permalink / raw)
To: Lorenzo Stoakes (ARM)
Cc: David Hildenbrand (Arm), airlied, akhilesh, akpm, corbet, dakr,
jgg, kees, leon, liam, lizhi.hou, lyude, maarten.lankhorst,
mamin506, mhocko, mripard, nouveau, ogabbay, oleg, rppt, shuah,
simona, skhan, surenb, tzimmermann, vbabka, dri-devel, linux-mm,
linux-doc, linux-kernel, linux-kselftest, linux-rdma
On Wed, Jul 15, 2026 at 05:02:59PM +0100, Lorenzo Stoakes (ARM) wrote:
> To avoid confusion: obviously please don't merge this series Andrew.
>
> On Wed, Jul 15, 2026 at 07:42:48AM -0700, Stanislav Kinsburskii wrote:
> > On Wed, Jul 15, 2026 at 02:41:43PM +0200, David Hildenbrand (Arm) wrote:
> > > On 7/15/26 00:21, Stanislav Kinsburskii wrote:
> > > > This small fixup series applies on top of:
> > > >
> > > > [PATCH v8 0/8] mm/hmm: Add mmap lock-drop support for userfaultfd-backed mappings
> > > >
> > > > The first patch updates the HMM documentation example to make the
> > > > mmu_interval_read_retry() state explicit: callers should use the notifier and
> > > > notifier_seq stored in the same hmm_range that was passed to
> > > > hmm_range_fault_unlocked_timeout().
> > > >
> > > > The remaining patches adjust nouveau, amdxdna, and drm_gpusvm users so the
> > > > timeout passed to hmm_range_fault_unlocked_timeout() is treated as a relative
> > > > HMM retry budget. These callers no longer keep an absolute deadline around
> > > > their outer driver retry loops or pass a computed remaining time into HMM.
> > > >
> > > > This keeps the timeout scoped to HMM's internal mmu-notifier retry handling. If
> > > > HMM succeeds and the driver later observes an invalidation through
> > > > mmu_interval_read_retry(), the driver retries the operation with a fresh HMM
> > > > retry budget.
> > > >
> > > > Changes in v2:
> > > > - Kept the nouveau outer absolute timeout around the
> > > > mmu_interval_read_retry() loop. hmm_range_fault_unlocked_timeout() only
> > > > bounds HMM’s internal retries, while nouveau faults are handled from a GPU
> > > > fault worker, so userspace fatal signals cannot break an endless stream of
> > > > invalidations there.
> > > > - Updated nouveau to use time_after_eq() before calling HMM, so the remaining
> > > > timeout passed to hmm_range_fault_unlocked_timeout() is always positive and
> > > > never 0, which would mean retry indefinitely.
> > > > - Updated the nouveau fixup commit message to explain the worker-thread
> > > > timeout issue and the time_after_eq() boundary behavior.
> > > > - Fixed the amdxdna fixup commit message. It now describes
> > > > aie2_populate_range() correctly instead of carrying stale nouveau prose,
> > > > and notes that command submission still keeps its broader timeout while HMM
> > > > gets a fresh relative retry budget.
> > > >
> > > >
> > > > ---
> > > >
> > > > Stanislav Kinsburskii (4):
> > > > fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support
> > > > fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults
> > > > fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population
> > > > fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults
> > >
> > > Why a fixup series instead of properly resending the full thing?
> > >
> >
> > The goal was to get a Sashiko review, and v8 has already been applied to
> > both `mm-new` and `linux-next`.
>
> Please don't do this, this is completely impossible to track for review :)
>
> mm review is currently very difficult based on volumes, it'll become impossible
> to manage if people sound fragments of series.
>
> Please just resend the whole thing at this point.
>
Well, I followed the guidance provided by Andrew, and I believe he
applied all of the changes, including these, to the `mm` tree.
Do you still want me to send v9 under these circumstances?
Thanks, Stanislav
> >
> > You can find more details here:
> >
> > https://sashiko.dev/#/message/alaWmUEeIBeSkmO0%40skinsburskii
> >
> > Thanks, Stanislav
> >
> > > --
> > > Cheers,
> > >
> > > David
>
> Thanks, Lorenzo
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts
2026-07-15 16:39 ` Stanislav Kinsburskii
@ 2026-07-15 17:14 ` Andrew Morton
0 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2026-07-15 17:14 UTC (permalink / raw)
To: Stanislav Kinsburskii
Cc: Lorenzo Stoakes (ARM), David Hildenbrand (Arm), airlied, akhilesh,
corbet, dakr, jgg, kees, leon, liam, lizhi.hou, lyude,
maarten.lankhorst, mamin506, mhocko, mripard, nouveau, ogabbay,
oleg, rppt, shuah, simona, skhan, surenb, tzimmermann, vbabka,
dri-devel, linux-mm, linux-doc, linux-kernel, linux-kselftest,
linux-rdma
On Wed, 15 Jul 2026 09:39:37 -0700 Stanislav Kinsburskii <skinsburskii@gmail.com> wrote:
> > > The goal was to get a Sashiko review, and v8 has already been applied to
> > > both `mm-new` and `linux-next`.
> >
> > Please don't do this, this is completely impossible to track for review :)
> >
> > mm review is currently very difficult based on volumes, it'll become impossible
> > to manage if people sound fragments of series.
> >
> > Please just resend the whole thing at this point.
> >
>
> Well, I followed the guidance provided by Andrew, and I believe he
> applied all of the changes, including these, to the `mm` tree.
>
> Do you still want me to send v9 under these circumstances?
Sure, if that's what reviewers prefer.
This is a bit unfriendly to people who have already reviewed the code.
Which is one of the reasons why I respond to a new version with a
single diff showing reviewers (and the author, and myself) what changed
since the previous version.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-07-15 17:14 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 22:21 [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 1/4] fixup! mm/hmm: add hmm_range_fault_unlocked_timeout() for mmap lock-drop support Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 2/4] fixup! drm/nouveau: use hmm_range_fault_unlocked_timeout() for SVM faults Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 3/4] fixup! accel/amdxdna: use hmm_range_fault_unlocked_timeout() for range population Stanislav Kinsburskii
2026-07-14 22:21 ` [PATCH v2 4/4] fixup! drm/gpusvm: use hmm_range_fault_unlocked_timeout() for range faults Stanislav Kinsburskii
2026-07-15 12:41 ` [PATCH v2 0/4] mm/hmm: Clarify notifier retry state and scope HMM timeouts David Hildenbrand (Arm)
2026-07-15 14:42 ` Stanislav Kinsburskii
2026-07-15 15:02 ` Jason Gunthorpe
2026-07-15 16:03 ` Lorenzo Stoakes (ARM)
2026-07-15 16:02 ` Lorenzo Stoakes (ARM)
2026-07-15 16:39 ` Stanislav Kinsburskii
2026-07-15 17:14 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox