lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260104194534.GA2247470@joelbox2>
Date: Sun, 4 Jan 2026 14:45:34 -0500
From: Joel Fernandes <joelagnelf@...dia.com>
To: Donglin Peng <dolinux.peng@...il.com>
Cc: paulmck@...nel.org, frederic@...nel.org, neeraj.upadhyay@...nel.org,
	qiang.zhang@...ux.dev, rostedt@...dmis.org, rcu@...r.kernel.org,
	linux-kernel@...r.kernel.org, Donglin Peng <pengdonglin@...omi.com>
Subject: Re: [PATCH] rcu: Align stall warning 'idle=' output with
 documentation

On Sun, Jan 04, 2026 at 04:10:27PM +0800, Donglin Peng wrote:
> From: Donglin Peng <pengdonglin@...omi.com>
> 
> The RCU stall warning message includes an "idle=" field to indicate
> the dyntick-idle state of a CPU. According to Documentation/RCU/stallwarn.rst,
> the hexadecimal number before the first '/' represents the low-order 16
> bits of the dynticks counter. An even value denotes that the CPU is in
> dyntick-idle mode, while an odd value indicates otherwise.
> 
> This was accurate until commit 171476775d32 ("context_tracking: Convert state to atomic_t"),
> which merged the context tracking state and the dynticks counter into a
> single atomic value. Consequently, the value printed in the stall warning
> no longer directly corresponds to the documented dynticks counter bits.
> 
> To restore consistency between the code's output and the documentation,
> right-shift the merged atomic state value to extract and display the
> correct low-order bits of the dynticks counter.
> 
> Fixes: 171476775d32 ("context_tracking: Convert state to atomic_t")
> Signed-off-by: Donglin Peng <pengdonglin@...omi.com>

Looks good to me! Also nice use of ilog2() which resolves to a single shift
right instruction per my testing (shift right of 2).

Reviewed-by: Joel Fernandes <joelagnelf@...dia.com>

thanks,

 - Joel


> ---
>  kernel/rcu/tree_stall.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
> index b67532cb8770..d25cc826d77a 100644
> --- a/kernel/rcu/tree_stall.h
> +++ b/kernel/rcu/tree_stall.h
> @@ -555,7 +555,7 @@ static void print_cpu_stall_info(int cpu)
>  			rdp->rcu_iw_pending ? (int)min(delta, 9UL) + '0' :
>  				"!."[!delta],
>  	       ticks_value, ticks_title,
> -	       ct_rcu_watching_cpu(cpu) & 0xffff,
> +	       (ct_rcu_watching_cpu(cpu) >> ilog2(CT_RCU_WATCHING)) & 0xffff,
>  	       ct_nesting_cpu(cpu), ct_nmi_nesting_cpu(cpu),
>  	       rdp->softirq_snap, kstat_softirqs_cpu(RCU_SOFTIRQ, cpu),
>  	       data_race(rcu_state.n_force_qs) - rcu_state.n_force_qs_gpstart,
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ