rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Zqiang <qiang.zhang@linux.dev>
Cc: paulmck@kernel.org, frederic@kernel.org,
	neeraj.upadhyay@kernel.org,  joelagnelf@nvidia.com,
	boqun@kernel.org, urezki@gmail.com, rcu@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH v2] srcu: Fix WARN_ON() for timer_delete_sync() in cleanup_srcu_struct()
Date: Wed, 12 Aug 2026 02:07:13 -0700	[thread overview]
Message-ID: <anw3uOzb-WXTh6B4@gmail.com> (raw)
In-Reply-To: <20260811002951.106631-1-qiang.zhang@linux.dev>

On Tue, Aug 11, 2026 at 08:29:51AM +0800, Zqiang wrote:
> The WARN_ON() for timer_delete_sync() means that the caller forgot
> to call srcu_barrier() before cleanup. however, it still can trigger
> even when srcu_barrier() was properly called.
> 
> When a SRCU grace period ends and find that the allocation of srcu_node
> tree has been completed, but the ss_state is still less than SRCU_SIZE_BIG,
> the mask=~0 causes delay_work timer be queued on every CPU which has
> been online regardless of whether it's sdp->srcu_cblist has callbacks.
> the srcu_barrier() only wait srcu_barrier_head's callbacks to complete,
> however, the srcu_barrier_head will not be inserted into an empty
> sdp->srcu_cblist. after that, when cleanup_srcu_struct() finds a pending
> delay_work timer on a CPU with no callbacks, triggering a false positive.
> 
> This commit therefore add rcu_segcblist_n_cbs() to WARN_ON(), make the
> warning triggers only when the timer is still pending and there are
> actual outstanding callbacks.
> 
> Fixes: 05c3e88488ed ("srcu: Queue sdp->work when the delay timer is successfully deleted")
> Reported-by: Breno Leitao <leitao@debian.org>
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Closes: https://lore.kernel.org/oe-lkp/202608060833.bce92909-lkp@intel.com/
> Tested-by: kernel test robot <oliver.sang@intel.com>
> Signed-off-by: Zqiang <qiang.zhang@linux.dev>

Tested-by: Breno Leitao <leitao@debian.org>

  parent reply	other threads:[~2026-08-12  9:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11  0:29 [PATCH v2] srcu: Fix WARN_ON() for timer_delete_sync() in cleanup_srcu_struct() Zqiang
2026-08-11 14:54 ` Frederic Weisbecker
2026-08-12  0:18   ` Paul E. McKenney
2026-08-12  9:07 ` Breno Leitao [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-08-10 10:55 Zqiang
2026-08-10 14:04 ` Breno Leitao
2026-08-10 23:31   ` Zqiang

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=anw3uOzb-WXTh6B4@gmail.com \
    --to=leitao@debian.org \
    --cc=boqun@kernel.org \
    --cc=frederic@kernel.org \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraj.upadhyay@kernel.org \
    --cc=oliver.sang@intel.com \
    --cc=paulmck@kernel.org \
    --cc=qiang.zhang@linux.dev \
    --cc=rcu@vger.kernel.org \
    --cc=urezki@gmail.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).