Re: [PATCH v7 7/8] accel/amdxdna: Use hmm_range_fault_unlocked_timeout() for range population
Jason Gunthorpe <[email protected]> Fri, 10 Jul 2026 13:43:45 -0300
| Newsgroups | org.kernel.vger.linux-hyperv,org.freedesktop.lists.dri-devel,org.freedesktop.lists.nouveau,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kernel.vger.linux-rdma,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jul 07, 2026 at 12:47:36PM -0700, Stanislav Kinsburskii wrote: > aie2_populate_range() takes mmap_read_lock() only around hmm_range_fault(). > It keeps a single HMM_RANGE_DEFAULT_TIMEOUT deadline for the populate pass > and retries -EBUSY until that deadline expires. > > Use hmm_range_fault_unlocked_timeout() instead. The HMM helper now owns > the mmap lock and refreshes mapp->range.notifier_seq for its internal > retries. Pass the remaining jiffies from the existing deadline to HMM, > while preserving the driver's existing outer loop for interval invalidation > retries and for selecting the next invalid mapping. > > Keep returning -ETIME when the retry budget expires, matching the driver's > existing timeout error convention. > > Signed-off-by: Stanislav Kinsburskii <[email protected]> > --- > drivers/accel/amdxdna/aie2_ctx.c | 17 +++-------------- > 1 file changed, 3 insertions(+), 14 deletions(-) Reviewed-by: Jason Gunthorpe <[email protected]> Jason