Re: [PATCH v7 6/8] RDMA/umem: Use hmm_range_fault_unlocked_timeout() for ODP faults

From: Jason Gunthorpe

Date: Fri Jul 10 2026 - 12:49:11 EST


On Tue, Jul 07, 2026 at 12:47:29PM -0700, Stanislav Kinsburskii wrote:
> ib_umem_odp_map_dma_and_lock() takes mmap_read_lock() only around
> hmm_range_fault(), then retries -EBUSY until HMM_RANGE_DEFAULT_TIMEOUT
> expires.
>
> Use hmm_range_fault_unlocked_timeout() instead. The HMM helper now owns
> the mmap lock and refreshes range->notifier_seq for its internal retries.
> ODP keeps using HMM_RANGE_DEFAULT_TIMEOUT for each HMM fault attempt,
> while interval invalidation retries continue to be handled by the existing
> outer loop.
>
> ODP still validates the interval notifier sequence while holding umem_mutex
> before DMA mapping pages.
>
> Signed-off-by: Stanislav Kinsburskii <skinsburskii@xxxxxxxxx>
> ---
> drivers/infiniband/core/umem_odp.c | 18 +++++-------------
> 1 file changed, 5 insertions(+), 13 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason