public inbox for rcu@vger.kernel.org
 help / color / mirror / Atom feed
From: Donglin Peng <dolinux.peng@gmail.com>
To: Joel Fernandes <joel@joelfernandes.org>
Cc: Zqiang <qiang.zhang@linux.dev>,
	Joel Fernandes <joelagnelf@nvidia.com>,
	paulmck@kernel.org,  frederic@kernel.org,
	neeraj.upadhyay@kernel.org, rostedt@goodmis.org,
	 rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Donglin Peng <pengdonglin@xiaomi.com>
Subject: Re: [PATCH] rcu: Align stall warning 'idle=' output with documentation
Date: Mon, 5 Jan 2026 09:31:24 +0800	[thread overview]
Message-ID: <CAErzpmsNu8NQ73ovB41Cam1_tc4doH52mwnt-Vw01=2K5xjiMw@mail.gmail.com> (raw)
In-Reply-To: <CAEXW_YSxHnUxNXNiwBZRiVF9i5OBv7bV73e_k_RFJ3Osnrr18Q@mail.gmail.com>

On Mon, Jan 5, 2026 at 8:34 AM Joel Fernandes <joel@joelfernandes.org> wrote:
>
> On Sun, Jan 4, 2026 at 7:32 PM Zqiang <qiang.zhang@linux.dev> wrote:
> >
> > >
> > > On Sun, Jan 04, 2026 at 04:10:27PM +0800, Donglin Peng wrote:
> > >
> > > >
> > > > From: Donglin Peng <pengdonglin@xiaomi.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.
> [...]
> > > >  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,
> >
> >
> >
> > May be also use CT_RCU_WATCHING_START to
> > replace ilog2(CT_RCU_WATCHING) operations? (I didn't actually test it)

Thank you for the suggestion. I agree that using the CT_RCU_WATCHING_START
macro is cleaner. I will fix it in the next version.

I noted that the CT_RCU_WATCHING_START macro was introduced in
kernel version 6.19-rc1 by commit d1e6d2773898 ("rcu: Add a
small-width RCU watching counter debug option").
Therefore, if this patch needs to be backported to older kernel versions
that lack this macro, using ilog2(CT_RCU_WATCHING) would be the
simpler, more compatible approach.

>
> It should compile down to the same thing, but either is fine with me.
>
> thanks,
>
>  - Joel

      reply	other threads:[~2026-01-05  1:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-04  8:10 [PATCH] rcu: Align stall warning 'idle=' output with documentation Donglin Peng
2026-01-04 19:45 ` Joel Fernandes
2026-01-05  0:26   ` Zqiang
2026-01-05  0:34     ` Joel Fernandes
2026-01-05  1:31       ` Donglin Peng [this message]

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='CAErzpmsNu8NQ73ovB41Cam1_tc4doH52mwnt-Vw01=2K5xjiMw@mail.gmail.com' \
    --to=dolinux.peng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraj.upadhyay@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=pengdonglin@xiaomi.com \
    --cc=qiang.zhang@linux.dev \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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