Re: [PATCH v8 5/8] drm/nouveau: Use hmm_range_fault_unlocked_timeout() for SVM faults

From: Andrew Morton

Date: Mon Jul 13 2026 - 19:18:34 EST


On Mon, 13 Jul 2026 09:59:17 -0700 Stanislav Kinsburskii <skinsburskii@xxxxxxxxx> wrote:

> > > 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?

That will return `timeout - jiffies': a smallish positive number.

I'm not sure what's intended here. Perhaps the code should be
using time_after() or similar?