mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <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
Subject: [PATCH tip/core/rcu 0/6] Remove scheduler restriction, update for v5.8
Date: Wed, 15 Apr 2020 10:55:43 -0700	[thread overview]
Message-ID: <20200415175543.GA10416@paulmck-ThinkPad-P72> (raw)

Hello!

This series removes the long-standing restriction preventing holding
of scheduler locks across rcu_read_unlock() unless interrupts have
been disabled across the entire RCU read-side critical section.

For example, with this series, the following code is now perfectly legal,
and is in fact tested by rcutorture:

	// Preemption is enabled.
	rcu_read_lock();
	do_something();
	raw_spin_lock_irqsave(&current->pi_lock, flags);
	rcu_read_unlock();
	raw_spin_unlock_irqrestore(&current->pi_lock, flags);

This change was enabled by the earlier changes that turn on
scheduler-clock interrupts for nohz_full CPUs that take too long to
report a quiescent state during a given grace period.  (Yes, nohz_full
CPUs executing in userspace still have their quiescent states implicitly
reported by the RCU grace-period kthread!)

And here is the series:

1.	Add KCSAN stubs to update.c.

2.	Make rcu_read_unlock_special() safe for rq/pi locks.

3.	Don't set nesting depth negative in rcu_preempt_deferred_qs(),
	courtesy of Lai Jiangshan.

4.	Remove unused ->rcu_read_unlock_special.b.deferred_qs field,
	courtesy of Lai Jiangshan.

5.	Don't use negative nesting depth in __rcu_read_unlock(),
	courtesy of Lai Jiangshan.

6.	Add test of holding scheduler locks across rcu_read_unlock().

							Thanx, Paul

------------------------------------------------------------------------

 include/linux/sched.h    |    2 +-
 kernel/rcu/rcutorture.c  |   10 +++++++++-
 kernel/rcu/tree_exp.h    |   31 +++++--------------------------
 kernel/rcu/tree_plugin.h |   45 +++++++++++++++------------------------------
 kernel/rcu/update.c      |   13 +++++++++++++
 5 files changed, 43 insertions(+), 58 deletions(-)

             reply	other threads:[~2020-04-15 17:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 17:55 Paul E. McKenney [this message]
2020-04-15 17:56 ` [PATCH tip/core/rcu 1/6] rcu: Add KCSAN stubs to update.c paulmck
2020-04-15 17:56 ` [PATCH tip/core/rcu 2/6] rcu: Make rcu_read_unlock_special() safe for rq/pi locks paulmck
2020-04-15 17:56 ` [PATCH tip/core/rcu 3/6] rcu: Don't set nesting depth negative in rcu_preempt_deferred_qs() paulmck
2020-04-15 17:56 ` [PATCH tip/core/rcu 4/6] rcu: Remove unused ->rcu_read_unlock_special.b.deferred_qs field paulmck
2020-04-15 17:56 ` [PATCH tip/core/rcu 5/6] rcu: Don't use negative nesting depth in __rcu_read_unlock() paulmck
2020-04-15 17:56 ` [PATCH tip/core/rcu 6/6] rcutorture: Add test of holding scheduler locks across rcu_read_unlock() 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=20200415175543.GA10416@paulmck-ThinkPad-P72 \
    --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

all inboxes | Powered by JetHome®