BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ankur Arora" <ankur.a.arora@oracle.com>, bpf@vger.kernel.org
Subject: Re: [PATCH v16 04/16] arm64: support WFET in smp_cond_load_relaxed_timeout()
Date: Fri, 16 Oct 2026 07:27:01 +0000	[thread overview]
Message-ID: <sashiko-outbox-173927@kernel.org> (raw)
In-Reply-To: <20261016070837.440748-5-ankur.a.arora@oracle.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] arm64: missing EXPORT_SYMBOL for cpu_poll_relax() dependencies
--

commit 763c188baf64d23043b0ab18c53d5eb2722c766e
Author: Ankur Arora <ankur.a.arora@oracle.com>

arm64: support WFET in smp_cond_load_relaxed_timeout()

This patch adds support for WFET in smp_cond_load_relaxed_timeout() and
smp_cond_load_acquire_timeout() by introducing timeout-aware variants of
__cmpwait() and cpu_poll_relax().

> diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h
> index e2263c754a550..3b024058cf2f6 100644
> --- a/arch/arm64/include/asm/barrier.h
> +++ b/arch/arm64/include/asm/barrier.h
[ ... ]
> @@ -235,7 +235,9 @@ extern bool arch_timer_evtstrm_available(void);
>  #define CPU_POLL_RELAX_WAITS
>  
>  #define cpu_poll_relax(ptr, val, timeout_ns) do {			\
> -	if (arch_timer_evtstrm_available())				\
> +	if (alternative_has_cap_unlikely(ARM64_HAS_WFXT))		\
> +		__cmpwait_relaxed_timeout(ptr, val, timeout_ns);	\
> +	else if (arch_timer_evtstrm_available())			\

[Severity: Low]
Does this lack an EXPORT_SYMBOL for loadable modules? 

Like __delay_cycles() below, arch_timer_evtstrm_available() is called within
a macro that can be expanded by loadable modules. If it isn't exported to
general modules, will modules using smp_cond_load_relaxed_timeout() fail to
link?

>  		__cmpwait_relaxed(ptr, val);				\
>  	else								\
>  		cpu_relax();						\
> diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h
> index 6cf3cd6873f5f..30dca19c9a7b5 100644
> --- a/arch/arm64/include/asm/cmpxchg.h
> +++ b/arch/arm64/include/asm/cmpxchg.h
[ ... ]
> @@ -235,20 +237,52 @@ __CMPWAIT_CASE( ,  , 64);
>  
>  #undef __CMPWAIT_CASE
>  
> -#define __CMPWAIT_GEN(sfx)						\
> -static __always_inline void __cmpwait##sfx(volatile void *ptr,		\
> -				  unsigned long val,			\
> -				  int size)				\
> +#define __CMPWAIT_TIMEOUT_CASE(w, sfx, sz)				\
> +static inline void __cmpwait_case_timeout_##sz(volatile void *ptr,	\
> +					       unsigned long val,	\
> +					       u64 timeout_ns)		\
> +{									\
> +	unsigned long tmp;						\
> +	u64 ecycles = __delay_cycles() +				\
> +			nsecs_to_cycles(timeout_ns);			\

[Severity: Low]
Will this cause linker errors for loadable modules?

Since __cmpwait_case_timeout_##sz() is an inline function instantiated by
generic barrier APIs like smp_cond_load_relaxed_timeout(), it injects a call
to __delay_cycles() into the caller. 

Is __delay_cycles() exported for use by loadable modules, or will this break
out-of-tree or standard kernel modules that include these headers and use the
timeout macros?

> +	asm volatile(							\
> +	"	sevl\n"							\
> +	"	wfe\n"							\
> +	"	ldxr" #sfx "\t%" #w "[tmp], %[v]\n"			\

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016070837.440748-1-ankur.a.arora@oracle.com?part=4

  reply	other threads:[~2026-10-16  7:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16  7:08 [PATCH v16 00/16] barrier: Add smp_cond_load_{relaxed,acquire}_timeout() Ankur Arora
2026-10-16  7:08 ` [PATCH v16 01/16] asm-generic: barrier: Add smp_cond_load_relaxed_timeout() Ankur Arora
2026-10-16  7:21   ` sashiko-bot
2026-10-16  7:55   ` bot+bpf-ci
2026-10-16  7:08 ` [PATCH v16 02/16] arm64: barrier: Support smp_cond_load_relaxed_timeout() Ankur Arora
2026-10-16  7:24   ` sashiko-bot
2026-10-16  7:08 ` [PATCH v16 03/16] arm64/delay: move, fixup usecs_to_cycles() Ankur Arora
2026-10-16  7:16   ` sashiko-bot
2026-10-16  7:55   ` bot+bpf-ci
2026-10-16 12:22   ` Catalin Marinas
2026-10-16  7:08 ` [PATCH v16 04/16] arm64: support WFET in smp_cond_load_relaxed_timeout() Ankur Arora
2026-10-16  7:27   ` sashiko-bot [this message]
2026-10-16  7:55   ` bot+bpf-ci
2026-10-16  7:08 ` [PATCH v16 05/16] arm64: rqspinlock: Remove private copy of smp_cond_load_acquire_timewait() Ankur Arora
2026-10-16  7:08 ` [PATCH v16 06/16] asm-generic: barrier: Add smp_cond_load_acquire_timeout() Ankur Arora
2026-10-16  7:21   ` sashiko-bot
2026-10-16  7:08 ` [PATCH v16 07/16] atomic: Add atomic_cond_read_*_timeout() Ankur Arora
2026-10-16  7:25   ` sashiko-bot
2026-10-16  7:08 ` [PATCH v16 08/16] locking/atomic: scripts: build atomic_long_cond_read_*_timeout() Ankur Arora
2026-10-16  7:08 ` [PATCH v16 09/16] bpf/rqspinlock: switch check_timeout() to a clock interface Ankur Arora
2026-10-16  7:08 ` [PATCH v16 10/16] bpf/rqspinlock: Use smp_cond_load_acquire_timeout() Ankur Arora
2026-10-16  7:08 ` [PATCH v16 11/16] sched: add need-resched timed wait interface Ankur Arora
2026-10-16  7:08 ` [PATCH v16 12/16] cpuidle/poll_state: Wait for need-resched via tif_need_resched_relaxed_wait() Ankur Arora
2026-10-16  7:08 ` [PATCH v16 13/16] arm64/delay: enable testing smp_cond_load_relaxed_timeout() Ankur Arora
2026-10-16  7:20   ` sashiko-bot
2026-10-16  7:08 ` [PATCH v16 14/16] barrier: add tests for smp_cond_load_*_timeout() Ankur Arora
2026-10-16  7:55   ` bot+bpf-ci
2026-10-16  7:08 ` [PATCH v16 15/16] barrier: timeout validity checks for smp_cond_load_relaxed_timeout() Ankur Arora
2026-10-16  7:19   ` sashiko-bot
2026-10-16  7:55   ` bot+bpf-ci
2026-10-16  7:08 ` [PATCH v16 16/16] barrier: timeout validity checks for smp_cond_load_acquire_timeout() Ankur Arora

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=sashiko-outbox-173927@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ankur.a.arora@oracle.com \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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