Re: [PATCH v10 09/12] bpf/rqspinlock: switch check_timeout() to a clock interface

From: Ankur Arora

Date: Wed Mar 25 2026 - 01:59:56 EST



Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> writes:

> On Mon, 16 Mar 2026 at 02:37, Ankur Arora <ankur.a.arora@xxxxxxxxxx> wrote:
>>
>> check_timeout() gets the current time value and depending on how
>> much time has passed, checks for deadlock or times out, returning 0
>> or -errno on deadlock or timeout.
>>
>> Switch this out to a clock style interface, where it functions as a
>> clock in the "lock-domain", returning the current time until a
>> deadlock or timeout occurs. Once a deadlock or timeout has occurred,
>> it stops functioning as a clock and returns error.
>>
>> Also adjust the RES_CHECK_TIMEOUT macro to discard the clock value
>> when updating the explicit return status.
>>
>> Cc: bpf@xxxxxxxxxxxxxxx
>> Cc: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>
>> Cc: Alexei Starovoitov <ast@xxxxxxxxxx>
>> Signed-off-by: Ankur Arora <ankur.a.arora@xxxxxxxxxx>
>> --
>
> Acked-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>

Thanks Kumar.

--
ankur