Re: [PATCH v5 02/15] rust: sync: completion: add wait_for_completion_timeout()
From: Gary Guo
Date: Fri Oct 02 2026 - 09:06:51 EST
On Fri Oct 2, 2026 at 1:12 PM BST, Alexandre Courbot wrote:
> On Fri Oct 2, 2026 at 8:13 PM JST, John Hubbard wrote:
>> On 10/2/26 12:55 PM, Alexandre Courbot wrote:
>>
>>> I will drop this patch and replace the code using this new method (which
>>> is just an optional probe-time self-test) by a polling loop on an
>>> atomic. That way we can wait for the helper method to be available and
>>> revisit this with the proper type.
>>
>> OK, whatever works best. Just in case, I did stage a fixed-up version
>> of the patch locally (in case I need to send a v6), as per Gary's
>> recommended Delta approach. It looks like this:
>
> It's your series so your call, but since the elegant solution will
> involve using [1] which is still under review, I would suggest waiting
> for it to introduce `wait_for_completion_timeout`, moving forward with
> the rest of the series, and revisit using completions once the base code
> is ready to limit churn.
>
> Otherwise we are at risk of missing the -rc6 cutoff for this series and
> that means an even busier next cycle. The polling code is also simpler
> overall than using completions, and for a probe-time selftest polling is
> really not a problem. Nova is not losing anything by not using
> completions for this.
I think putting it in without `.as_jiffies_unsigned` is fine. We can cleanup
later.
But the code shouldn't be using the postfix `.max()` for clamping and should be
using `isize::max` or `core::cmp::max` instead to avoid confusion, see
https://lore.kernel.org/rust-for-linux/DLMME4OBH3P8.3Q6UK95T2WGI@xxxxxxxxxxx/.
Best,
Gary