From: Ankur Arora <ankur.a.arora@oracle.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ankur Arora <ankur.a.arora@oracle.com>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org,
arnd@arndb.de, will@kernel.org, peterz@infradead.org,
akpm@linux-foundation.org, mark.rutland@arm.com,
harisokn@amazon.com, cl@gentwo.org, ast@kernel.org,
memxor@gmail.com, zhenglifeng1@huawei.com,
xueshuai@linux.alibaba.com, joao.m.martins@oracle.com,
boris.ostrovsky@oracle.com, konrad.wilk@oracle.com
Subject: Re: [PATCH v4 1/5] asm-generic: barrier: Add smp_cond_load_relaxed_timewait()
Date: Tue, 02 Sep 2025 14:34:25 -0700 [thread overview]
Message-ID: <87ecsor126.fsf@oracle.com> (raw)
In-Reply-To: <aLWDt9NpfYO_Utky@arm.com>
Catalin Marinas <catalin.marinas@arm.com> 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@arndb.de>
>> Cc: Will Deacon <will@kernel.org>
>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: linux-arch@vger.kernel.org
>> Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
>
> 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@arm.com>
Thanks for this and all the reviews.
--
ankur
next prev parent reply other threads:[~2025-09-03 0:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 8:07 [PATCH v4 0/5] barrier: Add smp_cond_load_*_timewait() Ankur Arora
2025-08-29 8:07 ` [PATCH v4 1/5] asm-generic: barrier: Add smp_cond_load_relaxed_timewait() Ankur Arora
2025-09-01 11:29 ` Catalin Marinas
2025-09-02 21:34 ` Ankur Arora [this message]
2025-08-29 8:07 ` [PATCH v4 2/5] arm64: " Ankur Arora
2025-09-01 11:47 ` Catalin Marinas
2025-09-02 22:40 ` Ankur Arora
2025-08-29 8:07 ` [PATCH v4 3/5] arm64: rqspinlock: Remove private copy of smp_cond_load_acquire_timewait Ankur Arora
2025-09-01 11:47 ` Catalin Marinas
2025-08-29 8:07 ` [PATCH v4 4/5] asm-generic: barrier: Add smp_cond_load_acquire_timewait() Ankur Arora
2025-09-01 11:47 ` Catalin Marinas
2025-08-29 8:07 ` [PATCH v4 5/5] rqspinlock: use smp_cond_load_acquire_timewait() Ankur Arora
2025-09-01 11:28 ` Catalin Marinas
2025-09-02 17:43 ` Alexei Starovoitov
2025-09-02 21:30 ` Ankur Arora
2025-09-02 21:31 ` Ankur Arora
2025-08-29 18:54 ` [PATCH v4 0/5] barrier: Add smp_cond_load_*_timewait() Okanovic, Haris
2025-08-29 22:38 ` Ankur Arora
2025-09-01 11:49 ` Catalin Marinas
2025-09-02 22:46 ` Ankur Arora
2025-09-03 9:27 ` Catalin Marinas
2025-09-03 18:34 ` Ankur Arora
2025-09-03 15:56 ` Okanovic, Haris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ecsor126.fsf@oracle.com \
--to=ankur.a.arora@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=ast@kernel.org \
--cc=boris.ostrovsky@oracle.com \
--cc=bpf@vger.kernel.org \
--cc=catalin.marinas@arm.com \
--cc=cl@gentwo.org \
--cc=harisokn@amazon.com \
--cc=joao.m.martins@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=memxor@gmail.com \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
--cc=xueshuai@linux.alibaba.com \
--cc=zhenglifeng1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).