platform/kernel/linux-rpi.git
5 years agotorture: Remove unnecessary "ret" variables
Pierce Griffiths [Sat, 22 Sep 2018 01:21:31 +0000 (20:21 -0500)]
torture: Remove unnecessary "ret" variables

Remove return variables (declared as "ret") in cases where,
depending on whether a condition evaluates as true, the result of a
function call can be immediately returned instead of storing the result in
the return variable. When the condition evaluates as false, the constant
initially stored in the return variable at declaration is returned instead.

Signed-off-by: Pierce Griffiths <pierceagriffiths@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcutorture: Affinity forward-progress test to avoid housekeeping CPUs
Paul E. McKenney [Sat, 22 Sep 2018 01:08:09 +0000 (18:08 -0700)]
rcutorture: Affinity forward-progress test to avoid housekeeping CPUs

This commit affinities the forward-progress tests to avoid hogging a
housekeeping CPU on the theory that the offloaded callbacks will be
running on those housekeeping CPUs.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
[ paulmck: Fix NULL-pointer issue located by kbuild test robot. ]
Tested-by: Rong Chen <rong.a.chen@intel.com>
5 years agorcutorture: Break up too-long rcu_torture_fwd_prog() function
Paul E. McKenney [Tue, 28 Aug 2018 21:38:43 +0000 (14:38 -0700)]
rcutorture: Break up too-long rcu_torture_fwd_prog() function

This commit splits rcu_torture_fwd_prog_nr() and rcu_torture_fwd_prog_cr()
functions out of rcu_torture_fwd_prog() in order to reduce indentation
pain and because rcu_torture_fwd_prog() was getting a bit too long.
In addition, this will enable easier conditional execution of the
rcu_torture_fwd_prog_cr() function, which can give false-positive
failures in some NO_HZ_FULL configurations due to overloading the
housekeeping CPUs.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcutorture: Remove cbflood facility
Paul E. McKenney [Mon, 27 Aug 2018 21:43:05 +0000 (14:43 -0700)]
rcutorture: Remove cbflood facility

Now that the forward-progress code does a full-bore continuous callback
flood lasting multiple seconds, there is little point in also posting a
mere 60,000 callbacks every second or so.  This commit therefore removes
the old cbflood testing.  Over time, it may be desirable to concurrently
do full-bore continuous callback floods on all CPUs simultaneously, but
one dragon at a time.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agotorture: Bring any extra CPUs online during kernel startup
Paul E. McKenney [Tue, 21 Aug 2018 22:27:16 +0000 (15:27 -0700)]
torture: Bring any extra CPUs online during kernel startup

Currently, the torture scripts rely on the initrd/init script to bring
any extra CPUs online, for example, in the case where the kernel and
qemu have different ideas about how many CPUs are present.  This works,
but is an unnecessary dependency on initrd, which needs to vary depending
on the distro.  This commit therefore causes torture_onoff() to check
for additional CPUs, attempting to bring any found online. Errors are
ignored, just as they are by the initrd/init script.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcutorture: Add call_rcu() flooding forward-progress tests
Paul E. McKenney [Wed, 15 Aug 2018 22:32:51 +0000 (15:32 -0700)]
rcutorture: Add call_rcu() flooding forward-progress tests

This commit adds a call_rcu() flooding loop to the forward-progress test.
This emulates tight userspace loops that force call_rcu() invocations,
for example, the infamous loop containing close(open()) that instigated
the addition of blimit.  If RCU does not make sufficient forward progress
in invoking the resulting flood of callbacks, rcutorture emits a warning.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agoMerge branches 'bug.2018.11.12a', 'consolidate.2018.12.01a', 'doc.2018.11.12a', ...
Paul E. McKenney [Sat, 1 Dec 2018 20:43:16 +0000 (12:43 -0800)]
Merge branches 'bug.2018.11.12a', 'consolidate.2018.12.01a', 'doc.2018.11.12a', 'fixes.2018.11.12a', 'initrd.2018.11.08b', 'sil.2018.11.12a' and 'srcu.2018.11.27a' into HEAD

bug.2018.11.12a:  Get rid of BUG_ON() and friends
consolidate.2018.12.01a:  Continued RCU flavor-consolidation cleanup
doc.2018.11.12a:  Documentation updates
fixes.2018.11.12a:  Miscellaneous fixes
initrd.2018.11.08b:  Automate creation of rcutorture initrd
sil.2018.11.12a:  Remove more spin_unlock_wait() calls

5 years agorcutorture/formal: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 23:27:40 +0000 (15:27 -0800)]
rcutorture/formal: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change,
even though it is but a comment.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agotools/kernel.h: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 23:25:13 +0000 (15:25 -0800)]
tools/kernel.h: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change,
even though it is but a comment.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: <linux-kernel@vger.kernel.org>
5 years agonet/decnet: Replace rcu_barrier_bh() with rcu_barrier()
Paul E. McKenney [Wed, 7 Nov 2018 23:12:34 +0000 (15:12 -0800)]
net/decnet: Replace rcu_barrier_bh() with rcu_barrier()

Now that all RCU flavors have been consolidated, rcu_barrier_bh()
is but a synonym for rcu_barrier().  This commit therefore replaces
the former with the latter.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <linux-decnet-user@lists.sourceforge.net>
Cc: <netdev@vger.kernel.org>
5 years agonet/core/skmsg: Replace call_rcu_sched() with call_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 23:09:25 +0000 (15:09 -0800)]
net/core/skmsg: Replace call_rcu_sched() with call_rcu()

Now that call_rcu()'s callback is not invoked until after all
preempt-disable regions of code have completed (in addition to explicitly
marked RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_sched().  This commit therefore makes that change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
5 years agolivepatch: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 22:16:57 +0000 (14:16 -0800)]
livepatch: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change,
even though it is but a comment.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agocgroups: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 22:11:40 +0000 (14:11 -0800)]
cgroups: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change,
even though it is but a comment.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: "Dennis Zhou (Facebook)" <dennisszhou@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
5 years agotypes: Remove call_rcu_bh() and call_rcu_sched()
Paul E. McKenney [Wed, 7 Nov 2018 22:01:39 +0000 (14:01 -0800)]
types: Remove call_rcu_bh() and call_rcu_sched()

Now that call_rcu()'s callback is not invoked until after bh-disable and
preempt-disable regions of code have completed (in addition to explicitly
marked RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_bh() and call_rcu_sched().  This commit therefore removes
these two API members from the callback_head structure's header comment.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
5 years agopercpu-rwsem: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 21:53:34 +0000 (13:53 -0800)]
percpu-rwsem: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change,
even though it is but a comment.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Christoph Lameter <cl@linux.com>
Acked-by: Tejun Heo <tj@kernel.org>
5 years agonet/bridge: Replace call_rcu_bh() and rcu_barrier_bh()
Paul E. McKenney [Wed, 7 Nov 2018 03:45:50 +0000 (19:45 -0800)]
net/bridge: Replace call_rcu_bh() and rcu_barrier_bh()

Now that call_rcu()'s callback is not invoked until after all bh-disable
regions of code have completed (in addition to explicitly marked
RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_bh().  Similarly, rcu_barrier() can be used in place of
rcu_barrier_bh().  This commit therefore makes these changes.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Roopa Prabhu <roopa@cumulusnetworks.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <bridge@lists.linux-foundation.org>
Cc: <netdev@vger.kernel.org>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
5 years agonet/core: Replace call_rcu_bh() and synchronize_rcu_bh()
Paul E. McKenney [Wed, 7 Nov 2018 03:43:32 +0000 (19:43 -0800)]
net/core: Replace call_rcu_bh() and synchronize_rcu_bh()

Now that call_rcu()'s callback is not invoked until after all bh-disable
regions of code have completed (in addition to explicitly marked
RCU read-side critical sections), call_rcu() can be used in place of
call_rcu_bh().  Similarly, synchronize_rcu() can be used in place of
synchronize_rcu_bh().  This commit therefore makes these changes.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: <netdev@vger.kernel.org>
5 years agonet/sched: Replace call_rcu_bh() and rcu_barrier_bh()
Paul E. McKenney [Wed, 7 Nov 2018 03:40:39 +0000 (19:40 -0800)]
net/sched: Replace call_rcu_bh() and rcu_barrier_bh()

Now that call_rcu()'s callback is not invoked until after bh-disable
regions of code have completed (in addition to explicitly marked
RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_bh().  Similarly, rcu_barrier() can be used in place o
frcu_barrier_bh().  This commit therefore makes these changes.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
5 years agosrcu: Use "ssp" instead of "sp" for srcu_struct pointer
Paul E. McKenney [Sun, 28 Oct 2018 17:32:51 +0000 (10:32 -0700)]
srcu: Use "ssp" instead of "sp" for srcu_struct pointer

In RCU, the distinction between "rsp", "rnp", and "rdp" has served well
for a great many years, but in SRCU, "sp" vs. "sdp" has proven confusing.
This commit therefore renames SRCU's "sp" pointers to "ssp", so that there
is "ssp" for srcu_struct pointer, "snp" for srcu_node pointer, and "sdp"
for srcu_data pointer.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agosrcu: Lock srcu_data structure in srcu_gp_start()
Dennis Krein [Fri, 26 Oct 2018 14:38:24 +0000 (07:38 -0700)]
srcu: Lock srcu_data structure in srcu_gp_start()

The srcu_gp_start() function is called with the srcu_struct structure's
->lock held, but not with the srcu_data structure's ->lock.  This is
problematic because this function accesses and updates the srcu_data
structure's ->srcu_cblist, which is protected by that lock.  Failing to
hold this lock can result in corruption of the SRCU callback lists,
which in turn can result in arbitrarily bad results.

This commit therefore makes srcu_gp_start() acquire the srcu_data
structure's ->lock across the calls to rcu_segcblist_advance() and
rcu_segcblist_accelerate(), thus preventing this corruption.

Reported-by: Bart Van Assche <bvanassche@acm.org>
Reported-by: Christoph Hellwig <hch@infradead.org>
Reported-by: Sebastian Kuzminsky <seb.kuzminsky@gmail.com>
Signed-off-by: Dennis Krein <Dennis.Krein@netapp.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Tested-by: Dennis Krein <Dennis.Krein@netapp.com>
Cc: <stable@vger.kernel.org> # 4.16.x
5 years agomm: Replace call_rcu_sched() with call_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 03:30:34 +0000 (19:30 -0800)]
mm: Replace call_rcu_sched() with call_rcu()

Now that call_rcu()'s callback is not invoked until after all
preempt-disable regions of code have completed (in addition to explicitly
marked RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_sched().  This commit therefore makes that change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agoslab: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 03:24:33 +0000 (19:24 -0800)]
slab: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>
5 years agopercpu-refcount: Replace call_rcu_sched() with call_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 03:22:23 +0000 (19:22 -0800)]
percpu-refcount: Replace call_rcu_sched() with call_rcu()

Now that call_rcu()'s callback is not invoked until after all
preempt-disable regions of code have completed (in addition to explicitly
marked RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_sched().  This commit therefore makes that change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>
Acked-by: Tejun Heo <tj@kernel.org>
5 years agoevents: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 03:20:05 +0000 (19:20 -0800)]
events: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
5 years agoworkqueue: Replace call_rcu_sched() with call_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 03:18:45 +0000 (19:18 -0800)]
workqueue: Replace call_rcu_sched() with call_rcu()

Now that call_rcu()'s callback is not invoked until after all
preempt-disable regions of code have completed (in addition to explicitly
marked RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_sched().  This commit therefore makes that change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
5 years agomodules: Replace synchronize_sched() and call_rcu_sched()
Paul E. McKenney [Wed, 7 Nov 2018 03:17:01 +0000 (19:17 -0800)]
modules: Replace synchronize_sched() and call_rcu_sched()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can
be replaced by synchronize_rcu().  Similarly, call_rcu_sched() can be
replaced by call_rcu().  This commit therefore makes these changes.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Acked-by: Jessica Yu <jeyu@kernel.org>
5 years agosched/membarrier: synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 03:09:14 +0000 (19:09 -0800)]
sched/membarrier: synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
5 years agolockdep: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 03:06:51 +0000 (19:06 -0800)]
lockdep: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
5 years agokprobes: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 7 Nov 2018 03:04:39 +0000 (19:04 -0800)]
kprobes: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
5 years agomain: Replace rcu_barrier_sched() with rcu_barrier()
Paul E. McKenney [Wed, 7 Nov 2018 02:58:01 +0000 (18:58 -0800)]
main: Replace rcu_barrier_sched() with rcu_barrier()

Now that all RCU flavors have been consolidated, rcu_barrier_sched()
is but a synonym for rcu_barrier().  This commit therefore replaces
the former with the latter.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <linux-mm@kvack.org>
5 years agotracing: Replace synchronize_sched() and call_rcu_sched()
Paul E. McKenney [Wed, 7 Nov 2018 02:44:52 +0000 (18:44 -0800)]
tracing: Replace synchronize_sched() and call_rcu_sched()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can
be replaced by synchronize_rcu().  Similarly, call_rcu_sched() can be
replaced by call_rcu().  This commit therefore makes these changes.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: <linux-kernel@vger.kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
5 years agofs/file: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Tue, 6 Nov 2018 01:31:31 +0000 (17:31 -0800)]
fs/file: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: <linux-fsdevel@vger.kernel.org>
5 years agocpufreq/cpufreq_governor: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Tue, 6 Nov 2018 01:23:56 +0000 (17:23 -0800)]
cpufreq/cpufreq_governor: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agocpufreq/intel_pstate: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Tue, 6 Nov 2018 01:17:47 +0000 (17:17 -0800)]
cpufreq/intel_pstate: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: <linux-pm@vger.kernel.org>
5 years agodrivers/vhost: Replace synchronize_rcu_bh() with synchronize_rcu()
Paul E. McKenney [Tue, 6 Nov 2018 01:14:53 +0000 (17:14 -0800)]
drivers/vhost: Replace synchronize_rcu_bh() with synchronize_rcu()

Now that synchronize_rcu() waits for bh-disable regions of code as well
as RCU read-side critical sections, synchronize_rcu_bh() can be replaced
by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: <kvm@vger.kernel.org>
Cc: <virtualization@lists.linux-foundation.org>
Cc: <netdev@vger.kernel.org>
5 years agoethernet/realtek: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Tue, 6 Nov 2018 01:07:39 +0000 (17:07 -0800)]
ethernet/realtek: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
5 years agoethernet/sis: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Tue, 6 Nov 2018 01:05:08 +0000 (17:05 -0800)]
ethernet/sis: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Francois Romieu <romieu@fr.zoreil.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
5 years agodrivers/ipmi: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Tue, 6 Nov 2018 01:00:58 +0000 (17:00 -0800)]
drivers/ipmi: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <openipmi-developer@lists.sourceforge.net>
Acked-by: Corey Minyard <cminyard@mvista.com>
5 years agocrypto/pcrypt: Replace synchronize_rcu_bh() with synchronize_rcu()
Paul E. McKenney [Tue, 6 Nov 2018 00:57:40 +0000 (16:57 -0800)]
crypto/pcrypt: Replace synchronize_rcu_bh() with synchronize_rcu()

Now that synchronize_rcu() waits for bh-disable regions of code as
well as RCU read-side critical sections, the synchronize_rcu_bh() in
pcrypt_cpumask_change_notify() can be replaced by synchronize_rcu().
This commit therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: <linux-crypto@vger.kernel.org>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
5 years agoKVM: arm/arm64: vgic: Replace spin_is_locked() with lockdep
Lance Roy [Fri, 5 Oct 2018 06:45:50 +0000 (23:45 -0700)]
KVM: arm/arm64: vgic: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Eric Auger <eric.auger@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: <kvmarm@lists.cs.columbia.edu>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Acked-by: Christoffer Dall <christoffer.dall@arm.com>
5 years agomm: Replace spin_is_locked() with lockdep
Lance Roy [Fri, 5 Oct 2018 06:45:47 +0000 (23:45 -0700)]
mm: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Yang Shi <yang.shi@linux.alibaba.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: <linux-mm@kvack.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agolocking/mutex: Replace spin_is_locked() with lockdep
Lance Roy [Fri, 5 Oct 2018 06:45:46 +0000 (23:45 -0700)]
locking/mutex: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agouserfaultfd: Replace spin_is_locked() with lockdep
Lance Roy [Fri, 5 Oct 2018 06:45:44 +0000 (23:45 -0700)]
userfaultfd: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: <linux-fsdevel@vger.kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agosmsc: Replace spin_is_locked() with lockdep
Lance Roy [Fri, 5 Oct 2018 06:45:42 +0000 (23:45 -0700)]
smsc: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Steve Glendinning <steve.glendinning@shawell.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agosfc: Replace spin_is_locked() with lockdep
Lance Roy [Fri, 5 Oct 2018 06:45:41 +0000 (23:45 -0700)]
sfc: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
Cc: Bert Kenward <bkenward@solarflare.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Acked-by: Edward Cree <ecree@solarflare.com>
5 years agocheckpatch.pl: Suggest lockdep instead of asserting !spin_is_locked()
Paul E. McKenney [Sun, 11 Nov 2018 18:49:10 +0000 (10:49 -0800)]
checkpatch.pl: Suggest lockdep instead of asserting !spin_is_locked()

This commit points people who might otherwise code up something like
WARN_ON(!spin_is_locked(&mylock)) to lockdep_assert_held(&mylock).

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
5 years agocheckpatch: Create table of obsolete APIs and apply to RCU
Joe Perches [Fri, 7 Sep 2018 22:26:18 +0000 (15:26 -0700)]
checkpatch: Create table of obsolete APIs and apply to RCU

This patch creates a deprecated_apis map, which allows such APIs to
be flagged with suggested replacements more compactly and straightforwardly.
It also uses this map to flag the old flavorful RCU APIs as deprecated,
suggesting their vanilla-RCU counterparts as replacements.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
[ paulmck: Merged with earlier less-deft approach. ]

5 years agoMAINTAINERS: Add Joel Fernandes as RCU reviewer
Paul E. McKenney [Tue, 6 Nov 2018 05:58:13 +0000 (21:58 -0800)]
MAINTAINERS:  Add Joel Fernandes as RCU reviewer

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Reviewed-by: Joel Fernandes <joel@joelfernandes.org>
5 years agorcu: Avoid signed integer overflow in rcu_preempt_deferred_qs()
Paul E. McKenney [Mon, 29 Oct 2018 14:36:50 +0000 (07:36 -0700)]
rcu: Avoid signed integer overflow in rcu_preempt_deferred_qs()

Subtracting INT_MIN can be interpreted as unconditional signed integer
overflow, which according to the C standard is undefined behavior.
Therefore, kernel build arguments notwithstanding, it would be good to
future-proof the code.  This commit therefore substitutes INT_MAX for
INT_MIN in order to avoid undefined behavior.

While in the neighborhood, this commit also creates some meaningful names
for INT_MAX and friends in order to improve readability, as suggested
by Joel Fernandes.

Reported-by: Ran Rozenstein <ranro@mellanox.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Replace this_cpu_ptr() with __this_cpu_read()
Paul E. McKenney [Mon, 5 Nov 2018 22:20:57 +0000 (14:20 -0800)]
rcu: Replace this_cpu_ptr() with __this_cpu_read()

Because __this_cpu_read() can be lighter weight than equivalent uses of
this_cpu_ptr(), this commit replaces the latter with the former.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Speed up expedited GPs when interrupting RCU reader
Paul E. McKenney [Tue, 16 Oct 2018 11:12:58 +0000 (04:12 -0700)]
rcu: Speed up expedited GPs when interrupting RCU reader

In PREEMPT kernels, an expedited grace period might send an IPI to a
CPU that is executing an RCU read-side critical section.  In that case,
it would be nice if the rcu_read_unlock() directly interacted with the
RCU core code to immediately report the quiescent state.  And this does
happen in the case where the reader has been preempted.  But it would
also be a nice performance optimization if immediate reporting also
happened in the preemption-free case.

This commit therefore adds an ->exp_hint field to the task_struct structure's
->rcu_read_unlock_special field.  The IPI handler sets this hint when
it has interrupted an RCU read-side critical section, and this causes
the outermost rcu_read_unlock() call to invoke rcu_read_unlock_special(),
which, if preemption is enabled, reports the quiescent state immediately.
If preemption is disabled, then the report is required to be deferred
until preemption (or bottom halves or interrupts or whatever) is re-enabled.

Because this is a hint, it does nothing for more complicated cases.  For
example, if the IPI interrupts an RCU reader, but interrupts are disabled
across the rcu_read_unlock(), but another rcu_read_lock() is executed
before interrupts are re-enabled, the hint will already have been cleared.
If you do crazy things like this, reporting will be deferred until some
later RCU_SOFTIRQ handler, context switch, cond_resched(), or similar.

Reported-by: Joel Fernandes <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
5 years agorcu: Trace end of grace period before end of grace period
Paul E. McKenney [Mon, 15 Oct 2018 17:00:58 +0000 (10:00 -0700)]
rcu: Trace end of grace period before end of grace period

Currently, rcu_gp_cleanup() traces the end of the old grace period after
the old grace period has officially ended.  This might make intuitive
sense, but it also makes for confusing event-trace output because the
"end" trace displays not the old but instead the new grace-period number.
This commit therefore traces the end of an old grace period just before
that grace period officially ends.

Reported-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Adjust the comment of function rcu_is_watching
Zhouyi Zhou [Mon, 8 Oct 2018 06:50:41 +0000 (06:50 +0000)]
rcu: Adjust the comment of function rcu_is_watching

Because RCU avoids interrupting idle CPUs, rcu_is_watching() is used to
test whether or not it is currently legal to run RCU read-side critical
sections on this CPU.  However, the first sentence and last sentences
of current comment for rcu_is_watching have opposite meaning of what
is expected.  This commit therefore fixes this header comment.

Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Add jiffies-since-GP-activity to show_rcu_gp_kthreads()
Paul E. McKenney [Tue, 2 Oct 2018 19:42:21 +0000 (12:42 -0700)]
rcu: Add jiffies-since-GP-activity to show_rcu_gp_kthreads()

This commit adds a printout of the number of jiffies since the last time
that the RCU grace-period kthread did any processing.  This can be useful
when tracking down forward-progress issues.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Add state name to show_rcu_gp_kthreads() output
Paul E. McKenney [Tue, 2 Oct 2018 18:24:08 +0000 (11:24 -0700)]
rcu: Add state name to show_rcu_gp_kthreads() output

This commit adds the name of the RCU grace-period state to
the show_rcu_gp_kthreads() output in order to ease debugging.
This commit also moves gp_state_getname() up in the code so that
show_rcu_gp_kthreads() can use it.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Parameterize rcu_check_gp_start_stall()
Paul E. McKenney [Mon, 1 Oct 2018 22:42:44 +0000 (15:42 -0700)]
rcu: Parameterize rcu_check_gp_start_stall()

In order to debug forward-progress stalls, it is necessary to check
for excessively delayed grace-period starts.  This is currently done
for RCU CPU stall warnings by rcu_check_gp_start_stall(), which checks
to see if the start of a requested grace period has been delayed by an
RCU CPU stall warning period.  Because rcutorture will need to check
for the time consumed by an RCU forward-progress delay, this commit
promotes gpssdelay from a local variable to a formal parameter.  It is
not necessary to export rcu_check_gp_start_stall() because rcutorture
will access it via a wrapper function.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Avoid double multiply by HZ
Paul E. McKenney [Mon, 1 Oct 2018 20:25:32 +0000 (13:25 -0700)]
rcu: Avoid double multiply by HZ

The rcu_check_gp_start_stall() function multiplies the return value
from rcu_jiffies_till_stall_check() by HZ, but the units are already
in jiffies.  This commit therefore avoids the need for introduction of
a jiffies-squared unit by removing the extraneous multiplication.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agoMAINTAINERS: Update from @linux.vnet.ibm.com to @linux.ibm.com
Paul E. McKenney [Fri, 14 Sep 2018 16:50:11 +0000 (09:50 -0700)]
MAINTAINERS: Update from @linux.vnet.ibm.com to @linux.ibm.com

IBM's patch-friendly email infrastructure is changing domains from
@linux.vnet.ibm.com to @linux.ibm.com, which if nothing else might
save a bit of typing.  This commit therefore updates us stragglers'
email addresses in the MAINTAINERS file.  The old addresses are
expected to continue to work for a few more months.

While in the neighborhood, remove some obsolete entries, which results
in an orphaned subsystem: "JSM Neo PCI based serial card".

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Douglas Miller <dougmill@linux.ibm.com>
Cc: Eddie James <eajames@linux.ibm.com>
Cc: Frank Haverkamp <haver@linux.ibm.com>
Cc: Frederic Barrat <fbarrat@linux.ibm.com>
Cc: John Allen <jallen@linux.ibm.com>
Cc: Manoj N. Kumar <manoj@linux.ibm.com>
Cc: Matthew R. Ochs <mrochs@linux.ibm.com>
Cc: Michael Cyr <mikecyr@linux.ibm.com>
Cc: Naveen N. Rao <naveen.n.rao@linux.ibm.com>
Cc: Paulo Flabiano Smorigo <pfsmorigo@linux.ibm.com>
Cc: Philip Kelleher <pjk1939@linux.ibm.com>
Cc: Steven Royer <seroyer@linux.ibm.com>
Cc: Thomas Falcon <tlfalcon@linux.ibm.com>
Cc: Tyrel Datwyler <tyreld@linux.ibm.com>
Cc: Uma Krishnan <ukrishn@linux.ibm.com>
Acked-by: James Bottomley <jejb@linux.ibm.com>
Acked-by: Mimi Zohar <zohar@linux.ibm.com>
5 years agodoc: Fix "struction" typo in RCU memory-ordering documentation
Joel Fernandes (Google) [Sun, 28 Oct 2018 04:30:46 +0000 (21:30 -0700)]
doc: Fix "struction" typo in RCU memory-ordering documentation

This commit replaces "struction" with the correct "structure".

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: Correct parameter in stallwarn
Joel Fernandes (Google) [Tue, 30 Oct 2018 05:15:59 +0000 (22:15 -0700)]
doc: Correct parameter in stallwarn

The stallwarn document incorrectly mentions 'fps=' instead of 'fqs='.
This commit orrects that.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: RCU scheduler spinlock rcu_read_unlock() restriction remains
Paul E. McKenney [Mon, 15 Oct 2018 17:54:13 +0000 (10:54 -0700)]
doc: RCU scheduler spinlock rcu_read_unlock() restriction remains

Given RCU flavor consolidation, when rcu_read_unlock() is invoked with
interrupts disabled, the reporting of the corresponding quiescent state is
deferred until interrupts are re-enabled.  There was therefore some hope
that this would allow dropping the restriction against holding scheduler
spinlocks across an rcu_read_unlock() without disabling interrupts across
the entire corresponding RCU read-side critical section.  Unfortunately,
the need to quickly provide a quiescent state to expedited grace periods
sometimes requires a call to raise_softirq() during rcu_read_unlock()
execution.  Because raise_softirq() can sometimes acquire the scheduler
spinlocks, the restriction must remain in effect.  This commit therefore
updates the RCU requirements documentation accordingly.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: Make listing in RCU perf/scale requirements use rcu_assign_pointer()
Joel Fernandes (Google) [Mon, 15 Oct 2018 02:29:42 +0000 (19:29 -0700)]
doc: Make listing in RCU perf/scale requirements use rcu_assign_pointer()

The code listing under this section has a quick quiz that says line
19 uses rcu_access_pointer, but the code listing itself instead uses
rcu_dereference().  This commit therefore makes the code listing match
the quick quiz.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: Remove obsolete (non-)requirement about disabling preemption
Joel Fernandes (Google) [Sun, 14 Oct 2018 21:29:55 +0000 (14:29 -0700)]
doc: Remove obsolete (non-)requirement about disabling preemption

The Requirements.html document says "Disabling Preemption Does
Not Block Grace Periods".  However this is no longer true with
the RCU consolidation.  This commit therefore removes the obsolete
(non-)requirement entirely.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: Make reader aware of rcu_dereference_protected
Joel Fernandes (Google) [Tue, 9 Oct 2018 01:33:41 +0000 (18:33 -0700)]
doc: Make reader aware of rcu_dereference_protected

The whatisRCU.txt document says rcu_dereference() cannot be used
outside of rcu_read_lock() protected sections.  The commit adds a
mention of rcu_dereference_protected(), so that the new reader knows
that this API can be used to avoid update-side use of rcu_read_lock()
and rcu_read_unlock().

Cc: tytso@mit.edu
Suggested-by: tytso@mit.edu
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
[ paulmck: Update wording, including further feedback from Joel. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: rcu: Encourage use of rcu_barrier in checklist
Joel Fernandes (Google) [Fri, 5 Oct 2018 23:18:14 +0000 (16:18 -0700)]
doc: rcu: Encourage use of rcu_barrier in checklist

The checklist suggests rcu_barrier_bh() for RCU-bh and similarly for
sched, however these APIs are now implemented as rcu_barrier() itself due
to the RCU consolidation. This commit therefore corrects checklist.txt
to encourage use of the underlying rcu_barrier() API.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: rcu: Remove obsolete checklist item about synchronize_rcu usage
Joel Fernandes (Google) [Fri, 5 Oct 2018 23:18:13 +0000 (16:18 -0700)]
doc: rcu: Remove obsolete checklist item about synchronize_rcu usage

Since the RCU mechanisms have been consolidated, the checklist item
warning that synchronize_rcu() waits only for RCU readers is obsolete.
This commit therefore removes this checklist item.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: rcu: Remove obsolete suggestion from checklist
Joel Fernandes (Google) [Fri, 5 Oct 2018 23:18:12 +0000 (16:18 -0700)]
doc: rcu: Remove obsolete suggestion from checklist

call_rcu_bh is now implemented in terms of call_rcu, so the suggestion
to use a different API for speed benefits is not accurate anymore.
This commit updates the document accordingly.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: rcu: Add more rationale for using rcu_read_lock_sched in checklist
Joel Fernandes (Google) [Fri, 5 Oct 2018 23:18:11 +0000 (16:18 -0700)]
doc: rcu: Add more rationale for using rcu_read_lock_sched in checklist

This commit explains why rcu_read_lock_sched is better than using
preempt_disable.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: rcu: Update core and full API in whatisRCU
Joel Fernandes (Google) [Fri, 5 Oct 2018 23:18:10 +0000 (16:18 -0700)]
doc: rcu: Update core and full API in whatisRCU

RCU consolidation effort causes the update side of the RCU API to
be consistent across all the 3 RCU flavors (normal, sched, bh). This
commit therefore updates the full API in the whatisRCU document, thus
encouraging people to use the consolidated RCU update API instead of
the old RCU-bh and RCU-sched update APIs.

Also rcu_dereference is documented to be the same for all 3 mechanisms
(even before the consolidation), however its actually different - as
using the right rcu_dereference primitive (such as rcu_dereference_bh
for bh) is needed to make lock debugging work correctly. This update
also corrects that.

Also, add local_bh_disable() and local_bh_enable() as softirq
protection primitives and correct a grammar error in a quiz answer.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: Document rcutorture forward-progress test kernel parameters
Paul E. McKenney [Mon, 1 Oct 2018 15:38:54 +0000 (08:38 -0700)]
doc: Document rcutorture forward-progress test kernel parameters

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: rcu: Update description of gp_seq fields in rcu_data
Joel Fernandes (Google) [Tue, 25 Sep 2018 18:26:01 +0000 (11:26 -0700)]
doc: rcu: Update description of gp_seq fields in rcu_data

The rcu_state structure doesn't have a gp_seq_needed field. Update the
description under rcu_data accordingly, to reflect this.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: <kernel-team@android.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: rcu: Better clarify the rcu_segcblist ->len field
Joel Fernandes (Google) [Tue, 25 Sep 2018 18:26:00 +0000 (11:26 -0700)]
doc: rcu: Better clarify the rcu_segcblist ->len field

An important note under the rcu_segcblist description could use a more
detailed description. Especially explanation of the scenario where the
->head field may be temporarily NULL making it not wise to rely on it
to determine if callbacks are associated with the rcu_segcblist.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: <kernel-team@android.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: rcu: Update Data-Structures for RCU flavor consolidation
Joel Fernandes (Google) [Thu, 4 Oct 2018 00:40:28 +0000 (17:40 -0700)]
doc: rcu: Update Data-Structures for RCU flavor consolidation

This patch updates all Data-Structures document figures and text and
removes some unwanted figures, to reflect the recent work Paul has been
doing with consolidating all flavors of RCU.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: <kernel-team@android.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: Remove rcu_dynticks from Data-Structures
Joel Fernandes (Google) [Thu, 4 Oct 2018 00:37:25 +0000 (17:37 -0700)]
doc: Remove rcu_dynticks from Data-Structures

rcu_dynticks was folded into rcu_data structure. Update the data
structures RCU document accordingly.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: <kernel-team@android.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: Update information about resched_cpu
Joel Fernandes (Google) [Tue, 25 Sep 2018 18:25:57 +0000 (11:25 -0700)]
doc: Update information about resched_cpu

Since commit fced9c8cfe6b ("rcu: Avoid resched_cpu() when rescheduling
the current CPU"), resched_cpu is not directly called from
sync_sched_exp_handler. Update the documentation about the same.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: <kernel-team@android.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Eliminate BUG_ON() for kernel/rcu/update.c
Paul E. McKenney [Mon, 22 Oct 2018 15:33:06 +0000 (08:33 -0700)]
rcu: Eliminate BUG_ON() for kernel/rcu/update.c

The update.c file has a number of calls to BUG_ON(), which panics the
kernel, which is not a good strategy for devices (like embedded) that
don't have a way to capture console output.  This commit therefore
converts these BUG_ON() calls to WARN_ON_ONCE() and WARN_ONCE().

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Eliminate BUG_ON() for kernel/rcu/tree_plugin.h
Paul E. McKenney [Mon, 22 Oct 2018 15:26:00 +0000 (08:26 -0700)]
rcu: Eliminate BUG_ON() for kernel/rcu/tree_plugin.h

The tree_plugin.h file has a number of calls to BUG_ON(), which panics
the kernel, which is not a good strategy for devices (like embedded)
that don't have a way to capture console output.  This commit therefore
converts these BUG_ON() calls to WARN_ON_ONCE() and WARN_ONCE().

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
[ paulmck: Fix typo: s/rcuo/rcub/. ]

5 years agorcu: Stop expedited grace periods from relying on stop-machine
Paul E. McKenney [Tue, 11 Sep 2018 15:57:48 +0000 (08:57 -0700)]
rcu: Stop expedited grace periods from relying on stop-machine

The CPU-selection code in sync_rcu_exp_select_cpus() disables preemption
to prevent the cpu_online_mask from changing.  However, this relies on
the stop-machine mechanism in the CPU-hotplug offline code, which is not
desirable (it would be good to someday remove the stop-machine mechanism).

This commit therefore instead uses the relevant leaf rcu_node structure's
->ffmask, which has a bit set for all CPUs that are fully functional.
A given CPU's bit is cleared very early during offline processing by
rcutree_offline_cpu() and set very late during online processing by
rcutree_online_cpu().  Therefore, if a CPU's bit is set in this mask, and
preemption is disabled, we have to be before the synchronize_sched() in
the CPU-hotplug offline code, which means that the CPU is guaranteed to be
workqueue-ready throughout the duration of the enclosing preempt_disable()
region of code.

This also has the side-effect of using WORK_CPU_UNBOUND if all the CPUs for
this leaf rcu_node structure are offline, which is an acceptable difference
in behavior.

Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agosrcu: Prevent __call_srcu() counter wrap with read-side critical section
Paul E. McKenney [Wed, 25 Apr 2018 20:01:25 +0000 (13:01 -0700)]
srcu: Prevent __call_srcu() counter wrap with read-side critical section

Ever since cdf7abc4610a ("srcu: Allow use of Tiny/Tree SRCU from
both process and interrupt context"), it has been permissible
to use SRCU read-side critical sections in interrupt context.
This allows __call_srcu() to use SRCU read-side critical sections to
prevent a new SRCU grace period from ending before the call to either
srcu_funnel_gp_start() or srcu_funnel_exp_start completes, thus preventing
SRCU grace-period counter overflow during that time.

Note that this does not permit removal of the counter-wrap checks in
srcu_gp_end().  These check are necessary to handle the case where
a given CPU does not interact at all with SRCU for an extended time
period.

This commit therefore adds an SRCU read-side critical section to
__call_srcu() in order to prevent grace period counter wrap during
the funnel-locking process.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agosrcu: Fix kernel-doc missing notation
Randy Dunlap [Mon, 3 Sep 2018 19:45:45 +0000 (12:45 -0700)]
srcu: Fix kernel-doc missing notation

Fix kernel-doc warnings for missing parameter descriptions:

../include/linux/srcu.h:175: warning: Function parameter or member 'p' not described in 'srcu_dereference_notrace'
../include/linux/srcu.h:175: warning: Function parameter or member 'sp' not described in 'srcu_dereference_notrace'

Fixes: 0b764a6e4e19d ("srcu: Add notrace variant of srcu_dereference")

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agox86/PCI: Replace spin_is_locked() with lockdep
Lance Roy [Fri, 5 Oct 2018 06:45:38 +0000 (23:45 -0700)]
x86/PCI: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <x86@kernel.org>
Cc: <linux-pci@vger.kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcutorture: Make use of nolibc when available
Willy Tarreau [Sun, 9 Sep 2018 11:33:02 +0000 (13:33 +0200)]
rcutorture: Make use of nolibc when available

This reduces the size of the init executable from ~800 kB to ~800 bytes
on x86_64. This is only implemented for x86_64, i386, arm and arm64.
Others not tested.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcutorture: Import a copy of nolibc
Willy Tarreau [Sun, 9 Sep 2018 11:26:04 +0000 (13:26 +0200)]
rcutorture: Import a copy of nolibc

This is a definition of the most common syscalls needed in minimalist
init executables, allowing to statically build them with no external
dependencies. It is sufficient in its current form to build rcutorture's
init on x86_64, i386, arm, and arm64. Others have not been ported or
tested. Updates may be found here :

     http://git.formilux.org/?p=people/willy/nolibc.git

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcutorture: Check initrd/init instead of initrd only
Willy Tarreau [Sun, 9 Sep 2018 09:46:48 +0000 (11:46 +0200)]
rcutorture: Check initrd/init instead of initrd only

If the build fails, we can end up with an empty initrd directory which
prevents the build script from operating again. Better rely on the
resulting init executable instead.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcutorture: Always strip using the cross-compiler
Willy Tarreau [Sun, 9 Sep 2018 09:41:10 +0000 (11:41 +0200)]
rcutorture: Always strip using the cross-compiler

Strip using -s on the compiler command line instead of calling the "strip"
utility as the latter isn't necessarily compatible with the target arch.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcutorture: Add cross-compile capability to initrd.sh
Paul E. McKenney [Thu, 6 Sep 2018 17:26:07 +0000 (10:26 -0700)]
rcutorture: Add cross-compile capability to initrd.sh

This adds the CROSS_COMPILE environment to the initrd.sh script's
gcc command to enable cross compilation.

Reported-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcutorture: Make initrd/init execute in userspace
Paul E. McKenney [Thu, 23 Aug 2018 22:23:23 +0000 (15:23 -0700)]
rcutorture: Make initrd/init execute in userspace

Currently, the initrd/init script and executable remain blocked almost
all the time.  However, it is necessary to test nohz_full userspace
execution, which both variants of initrd/init fail to do.  This commit
therefore causes initrd/init to spend about a millisecond per second
executing in userspace.

Reported-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcutorture: Add initrd support for systems lacking dracut
Paul E. McKenney [Thu, 23 Aug 2018 17:48:18 +0000 (10:48 -0700)]
rcutorture: Add initrd support for systems lacking dracut

The support for creating initrd directories using dracut is a great
improvement over having to always hand-create them, it is a bit annoying
to have to install some otherwise irrelevant package just to be able to
run rcutorture.  This commit therefore adds support for creating initrd
directories on systems innocent of dracut.  You do need gcc, but then
again you need that to build the kernel (or to build llvm) in any case.

The idea is to create an initrd directory containing nothing but a
statically linked binary having a for-loop over a long-term sleep().
The result is a Linux kernel with almost no userspace: even the
time-honored /dev, /lib, /tmp, and /usr directories are gone.  In fact,
the only directory present is "/", but only because I don't know how to
get rid of it, at least short of not having an initrd in the first place.
Although statically linked binaries are much maligned, and rightly so,
their disadvantages seem to be irrelevant for this particular use case.
From https://www.akkadia.org/drepper/no_static_linking.html:

1. Fixes are difficult to apply to hordes of widely scattered
statically linked binaries.  But in this case, there is only one
binary, but there would otherwise be no fewer than four libraries.

2. Security measures like local address randomization cannot be used.
Prudence prevents me from asserting that it is impossible to
base a remote attack on a networking-free rcutorture instance.
Nevertheless, bonus points to the first person who comes up with
such an attack!

3. More efficient use of physical memory.  Not in this case, given
that libc is 1.8MB and the statically linked binary "only" 800K.

4. Features such as locales, name service switch (NSS),
internationalized domain names (IDN) tool, and so on require
dynamic linking.  Bonus points to the first person coming up
with a valid rcutorture use case requiring these features in
its initrd.

5. Accidental violations of (L)GPL.  Actually, this change actually
helps -avoid- such violations by reducing the temptation to
pass around tarballs of rcutorture-ready initrd directories.
After all, the rcutorture scripts automatically create an initrd
directory for you, so why bother with the tarballs?

6. Tools and hacks like ltrace, LD_PRELOAD, LD_PROFILE, and LD_AUDIT
don't work.  Again, bonus points to the first person coming up
with a valid rcutorture use case requiring these features in
its initrd.

Nevertheless, the script will use dracut if available, and will create the
statically linked binary only when dracut are missing.  Those preferring
the smaller initrd directory resulting from the statically linked binary
(like me) are free to hand-edit mkinitrd.sh to remove the code using
dracut.  ;-)

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcutorture: Automatically create initrd directory
Connor Shu [Wed, 22 Aug 2018 21:16:46 +0000 (14:16 -0700)]
rcutorture: Automatically create initrd directory

The rcutorture scripts currently expect the user to create the
tools/testing/selftests/rcutorture/initrd directory.  Should the user
fail to do this, the kernel build will fail with obscure and confusing
error messages.  This commit therefore adds explicit checks for the
tools/testing/selftests/rcutorture/initrd directory, and if not present,
creates one on systems on which dracut is installed.  If this directory
could not be created, a less obscure error message is emitted and the
test is aborted.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Connor Shu <Connor.Shu@ibm.com>
[ paulmck: Adapt the script to fit into the rcutorture framework and
  severely abbreviate the initrd/init script. ]
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agodoc: Remove rcu_preempt_state reference in stallwarn
Joel Fernandes (Google) [Sat, 22 Sep 2018 23:41:27 +0000 (19:41 -0400)]
doc: Remove rcu_preempt_state reference in stallwarn

Consolidation of RCU-bh, RCU-preempt, and RCU-sched into one RCU flavor
to rule them all resulted in the removal of rcu_preempt_state.  However,
stallwarn.txt still mentions rcu_preempt_state.  This commit therefore
Updates stallwarn documentation accordingly.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: <kernel-team@android.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: Clarify RCU data-structure comment about rcu_tree fanout
Joel Fernandes (Google) [Fri, 21 Sep 2018 22:31:53 +0000 (18:31 -0400)]
doc: Clarify RCU data-structure comment about rcu_tree fanout

RCU Data-Structures document describes a trick to test RCU with small
number of CPUs but with a taller tree. It wasn't immediately clear how
the document arrived at 16 CPUs which also requires setting the
FANOUT_LEAF to 2 instead of the default of 16.  This commit therefore
provides the needed clarification.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: <kernel-team@android.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agodoc: Set down forward-progress requirements
Paul E. McKenney [Wed, 29 Aug 2018 20:37:47 +0000 (13:37 -0700)]
doc: Set down forward-progress requirements

This commit adds a section to the requirements documentation setting down
requirements for grace-period and callback-invocation forward progress.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agopowerpc: Convert hugepd_free() to use call_rcu()
Paul E. McKenney [Tue, 6 Nov 2018 00:53:13 +0000 (16:53 -0800)]
powerpc: Convert hugepd_free() to use call_rcu()

Now that call_rcu()'s callback is not invoked until after all
preempt-disable regions of code have completed (in addition to explicitly
marked RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_sched().  This commit therefore makes that change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: <linuxppc-dev@lists.ozlabs.org>
5 years agos390/mm: Convert tlb_table_flush() to use call_rcu()
Paul E. McKenney [Tue, 30 Oct 2018 23:30:07 +0000 (16:30 -0700)]
s390/mm: Convert tlb_table_flush() to use call_rcu()

Now that call_rcu()'s callback is not invoked until after all
preempt-disable regions of code have completed (in addition to explicitly
marked RCU read-side critical sections), call_rcu() can be used in place
of call_rcu_sched().  This commit therefore makes that change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: <linux-s390@vger.kernel.org>
5 years agosparc/oprofile: Convert timer_stop() to use synchronize_rcu()
Paul E. McKenney [Tue, 30 Oct 2018 22:45:04 +0000 (15:45 -0700)]
sparc/oprofile: Convert timer_stop() to use synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
in addition to explicitly marked RCU read-side critical sections,
synchronize_rcu() can be used in place of synchronize_sched().  This
commit therefore makes that change.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Cc: Robert Richter <rric@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <oprofile-list@lists.sf.net>
Cc: <sparclinux@vger.kernel.org>
5 years agosched/membarrier: Replace synchronize_sched() with synchronize_rcu()
Paul E. McKenney [Wed, 11 Jul 2018 22:36:43 +0000 (15:36 -0700)]
sched/membarrier: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, the synchronize_sched()
in sys_membarrier() can be replaced by synchronize_rcu().  This commit
therefore makes this change.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 years agorcu: Consolidate the RCU update functions invoked by sync.c
Paul E. McKenney [Wed, 11 Jul 2018 21:42:53 +0000 (14:42 -0700)]
rcu: Consolidate the RCU update functions invoked by sync.c

This commit retains all the various gp_ops[] entries, but makes their
update functions all be synchronize_rcu(), call_rcu() and rcu_barrier().
The read-side checks remain consistent with the various RCU flavors,
which still exist on the read side.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
5 years agorcu: Eliminate synchronize_rcu_mult()
Paul E. McKenney [Wed, 11 Jul 2018 21:36:49 +0000 (14:36 -0700)]
rcu: Eliminate synchronize_rcu_mult()

Now that synchronize_rcu() waits for both RCU read-side critical
sections and preempt-disabled regions of code, the sole caller of
synchronize_rcu_mult() can be replaced by synchronize_rcu().
This patch makes this change and removes synchronize_rcu_mult().
Note that _wait_rcu_gp() still supports synchronize_rcu_mult(),
and thus might be simplified in the future to take only take
a single call_rcu() function rather than the current list of them.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
5 years agorcu: Fix rcu_{node,data} comments about gp_seq_needed
Joel Fernandes (Google) [Sat, 22 Sep 2018 23:41:26 +0000 (19:41 -0400)]
rcu: Fix rcu_{node,data} comments about gp_seq_needed

Recent changes have removed the old ->gp_seq_needed field from the
rcu_state structure, which in turn obsoleted a couple of comments in
the rcu_node and rcu_data structures.  This commit therefore updates
these comments accordingly.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: <kernel-team@android.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
5 years agorcu: Remove unused rcu_state externs
Joel Fernandes (Google) [Sat, 22 Sep 2018 23:41:25 +0000 (19:41 -0400)]
rcu: Remove unused rcu_state externs

The rcu_bh_state and rcu_sched_state variables were removed during the
RCU flavor consolidations, but external declarations remain in tree.h.
This commit therefore removes these obsolete declarations.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: <kernel-team@android.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>