rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: paulmck@kernel.org
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com,
	mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
	"Paul E. McKenney" <paulmck@kernel.org>
Subject: [PATCH tip/core/rcu 19/24] rcu/nocb: Add a warning for non-GP kthread running GP code
Date: Mon, 31 Aug 2020 11:01:11 -0700	[thread overview]
Message-ID: <20200831180116.32690-19-paulmck@kernel.org> (raw)
In-Reply-To: <20200831180050.GA32590@paulmck-ThinkPad-P72>

From: "Paul E. McKenney" <paulmck@kernel.org>

This commit increases RCU's ability to defend itself by emitting a warning
if one of the nocb CB kthreads invokes the GP kthread's wait function.
This warning augments a similar check that is carried out at the end
of rcutorture testing and when RCU CPU stall warnings are emitted.
The problem with those checks is that the miscreants have long since
departed and disposed of any and all evidence.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 kernel/rcu/tree_plugin.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 4d63ee3..cb1e8c8 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1926,6 +1926,7 @@ static void nocb_gp_wait(struct rcu_data *my_rdp)
 	 * nearest grace period (if any) to wait for next.  The CB kthreads
 	 * and the global grace-period kthread are awakened if needed.
 	 */
+	WARN_ON_ONCE(my_rdp->nocb_gp_rdp != my_rdp);
 	for (rdp = my_rdp; rdp; rdp = rdp->nocb_next_cb_rdp) {
 		trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("Check"));
 		rcu_nocb_lock_irqsave(rdp, flags);
-- 
2.9.5


  parent reply	other threads:[~2020-08-31 18:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-31 18:00 [PATCH tip/core/rcu 0/24] Miscellaneous fixes for v5.10 Paul E. McKenney
2020-08-31 18:00 ` [PATCH tip/core/rcu 01/24] rcu: Remove KCSAN stubs paulmck
2020-08-31 18:00 ` [PATCH tip/core/rcu 02/24] rcu: Remove KCSAN stubs from update.c paulmck
2020-08-31 18:00 ` [PATCH tip/core/rcu 03/24] srcu: Remove KCSAN stubs paulmck
2020-08-31 18:00 ` [PATCH tip/core/rcu 04/24] rcu: Initialize at declaration time in rcu_exp_handler() paulmck
2020-08-31 18:00 ` [PATCH tip/core/rcu 05/24] rcu/trace: Print negative GP numbers correctly paulmck
2020-08-31 18:00 ` [PATCH tip/core/rcu 06/24] rcu/trace: Use gp_seq_req in acceleration's rcu_grace_period tracepoint paulmck
2020-08-31 18:00 ` [PATCH tip/core/rcu 07/24] nocb: Clarify RCU nocb CPU error message paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 08/24] rcu/tree: Force quiescent state on callback overload paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 09/24] rcu/tree: Remove CONFIG_PREMPT_RCU check in force_qs_rnp() paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 10/24] nocb: Remove show_rcu_nocb_state() false positive printout paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 11/24] rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_divisor paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 12/24] rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_resched_ns paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 13/24] rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_kick_kthreads paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 14/24] rcu: Add READ_ONCE() to rcu_do_batch() access to rcu_cpu_stall_ftrace_dump paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 15/24] rcu: Fix kerneldoc comments in rcupdate.h paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 16/24] rculist: Introduce list/hlist_for_each_entry_srcu() macros paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 17/24] kvm: mmu: page_track: Fix RCU list API usage paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 18/24] rcu: Move rcu_cpu_started per-CPU variable to rcu_data paulmck
2020-08-31 18:01 ` paulmck [this message]
2020-08-31 18:01 ` [PATCH tip/core/rcu 20/24] rcu: Clarify comments about FQS loop reporting quiescent states paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 21/24] rcu: Make FQS more aggressive in complaining about offline CPUs paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 22/24] rcu: Remove unused __rcu_is_watching() function paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 23/24] rcu/segcblist: Prevent useless GP start if no CBs to accelerate paulmck
2020-08-31 18:01 ` [PATCH tip/core/rcu 24/24] rcu: Shrink each possible cpu krcp paulmck

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=20200831180116.32690-19-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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).