Re: [PATCH v4 1/5] asm-generic: barrier: Add smp_cond_load_relaxed_timewait()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Catalin Marinas <catalin.marinas@xxxxxxx> writes:

> On Fri, Aug 29, 2025 at 01:07:31AM -0700, Ankur Arora wrote:
>> Add smp_cond_load_relaxed_timewait(), which extends
>> smp_cond_load_relaxed() to allow waiting for a finite duration.
>>
>> The additional parameter allows for the timeout check.
>>
>> The waiting is done via the usual cpu_relax() spin-wait around the
>> condition variable with periodic evaluation of the time-check.
>>
>> The number of times we spin is defined by SMP_TIMEWAIT_SPIN_COUNT
>> (chosen to be 200 by default) which, assuming each cpu_relax()
>> iteration takes around 20-30 cycles (measured on a variety of x86
>> platforms), amounts to around 4000-6000 cycles.
>>
>> Cc: Arnd Bergmann <arnd@xxxxxxxx>
>> Cc: Will Deacon <will@xxxxxxxxxx>
>> Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
>> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
>> Cc: linux-arch@xxxxxxxxxxxxxxx
>> Signed-off-by: Ankur Arora <ankur.a.arora@xxxxxxxxxx>
>
> Apart from the name, this looks fine (I'd have preferred the "timeout"
> suffix).

So, the suffix "timewait" made sense to me because I was trying to
differentiate with spinwait etc.

Given that that issue is no longer meaningful, "timeout" makes more sense.

Will change.

> Reviewed-by: Catalin Marinas <catalin.marinas@xxxxxxx>

Thanks for this and all the reviews.

--
ankur




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux