On Fri, Jul 10, 2026 at 10:48:33PM -0700, Andrew Morton wrote:
> On Fri, 10 Jul 2026 20:16:35 -0700 Stanislav Kinsburskii 
> <[email protected]> wrote:
> 
> > On Fri, Jul 10, 2026 at 03:12:22PM -0700, Andrew Morton wrote:
> > > On Fri, 10 Jul 2026 14:26:58 -0700 Stanislav Kinsburskii 
> > > <[email protected]> wrote:
> > > 
> > > > @@ -683,15 +683,11 @@ static int nouveau_range_fault(struct 
> > > > nouveau_svmm *svmm,
> > > >                         goto out;
> > > >                 }
> > > >  
> > > > -               range.notifier_seq = 
> > > > mmu_interval_read_begin(range.notifier);
> > > > -               mmap_read_lock(mm);
> > > > -               ret = hmm_range_fault(&range);
> > > > -               mmap_read_unlock(mm);
> > > > -               if (ret) {
> > > > -                       if (ret == -EBUSY)
> > > > -                               continue;
> > > > +               ret = hmm_range_fault_unlocked_timeout(&range,
> > > > +                                                      max(timeout - 
> > > > jiffies,
> > > > +                                                          1L));
> > > 
> > > "1UL" here?  I'd have expected min() to warn, as it likes to do.
> > 
> > I'm not sure... The "timeout - jiffies" can become negative.
> > Won't 1UL convert both of them to "UL" and thus make the comparison
> > overflow?
> 
> `timeout' and `jiffies' are both unsigned long.

Yeah, I’m sorry for the sloppy wording.

What I meant was: will "max(timeout - jiffies, 1UL)" correctly handle
the case where jiffies < timeout?

Thanks,
Stanislav

Reply via email to