Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1695187 > unrolled thread

[PATCH tip/core/rcu 0/4] SRCU updates

Started by"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
First post2017-07-25 00:20 +0200
Last post2017-07-25 00:20 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH tip/core/rcu 0/4] SRCU updates "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:20 +0200
    [PATCH tip/core/rcu 2/4] rcutorture: Remove obsolete SRCU-C.boot "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:20 +0200
    [PATCH tip/core/rcu 4/4] srcu: Provide ordering for CPU not involved in grace period "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:20 +0200

#1695187 — [PATCH tip/core/rcu 0/4] SRCU updates

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2017-07-25 00:20 +0200
Subject[PATCH tip/core/rcu 0/4] SRCU updates
Message-ID<u6TRM-2Hk-21@gated-at.bofh.it>
Hello!

This series contains a few SRCU updates:

1.	Move rcu_scheduler_starting() from Tiny RCU to Tiny SRCU.

2.	Remove obsolete SRCU-C.boot kernel-parameter file

3.	Make process_srcu() be static.

4.	Provide ordering for CPU not involved in grace period.

							Thanx, Paul

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

 b/include/linux/rcupdate.h                                 |    1 
 b/include/linux/rcutiny.h                                  |    8 --
 b/include/linux/srcutree.h                                 |    2 
 b/kernel/rcu/srcutiny.c                                    |    8 ++
 b/kernel/rcu/srcutree.c                                    |   13 +++
 b/kernel/rcu/tiny.c                                        |    2 
 kernel/rcu/tiny_plugin.h                                   |   47 -------------
 tools/testing/selftests/rcutorture/configs/rcu/SRCU-C.boot |    1 
 8 files changed, 23 insertions(+), 59 deletions(-)

[toc] | [next] | [standalone]


#1695190 — [PATCH tip/core/rcu 2/4] rcutorture: Remove obsolete SRCU-C.boot

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2017-07-25 00:20 +0200
Subject[PATCH tip/core/rcu 2/4] rcutorture: Remove obsolete SRCU-C.boot
Message-ID<u6TRN-2Hk-39@gated-at.bofh.it>
In reply to#1695187
Classic SRCU is no more, so this commit removes the corresponding
rcutorture boot-parameters file.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 tools/testing/selftests/rcutorture/configs/rcu/SRCU-C.boot | 1 -
 1 file changed, 1 deletion(-)
 delete mode 100644 tools/testing/selftests/rcutorture/configs/rcu/SRCU-C.boot

diff --git a/tools/testing/selftests/rcutorture/configs/rcu/SRCU-C.boot b/tools/testing/selftests/rcutorture/configs/rcu/SRCU-C.boot
deleted file mode 100644
index 84a7d51b7481..000000000000
--- a/tools/testing/selftests/rcutorture/configs/rcu/SRCU-C.boot
+++ /dev/null
@@ -1 +0,0 @@
-rcutorture.torture_type=srcud
-- 
2.5.2

[toc] | [prev] | [next] | [standalone]


#1695191 — [PATCH tip/core/rcu 4/4] srcu: Provide ordering for CPU not involved in grace period

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2017-07-25 00:20 +0200
Subject[PATCH tip/core/rcu 4/4] srcu: Provide ordering for CPU not involved in grace period
Message-ID<u6TRN-2Hk-41@gated-at.bofh.it>
In reply to#1695187
Tree RCU guarantees that every online CPU has a memory barrier between
any given grace period and any of that CPU's RCU read-side sections that
must be ordered against that grace period.  Since RCU doesn't always
know where read-side critical sections are, the actual implementation
guarantees order against prior and subsequent non-idle non-offline code,
whether in an RCU read-side critical section or not.  As a result, there
does not need to be a memory barrier at the end of synchronize_rcu()
and friends because the ordering internal to the grace period has
ordered every CPU's post-grace-period execution against each CPU's
pre-grace-period execution, again for all non-idle online CPUs.

In contrast, SRCU can have non-idle online CPUs that are completely
uninvolved in a given SRCU grace period, for example, a CPU that
never runs any SRCU read-side critical sections and took no part in
the grace-period processing.  It is in theory possible for a given
synchronize_srcu()'s wakeup to be delivered to a CPU that was completely
uninvolved in the prior SRCU grace period, which could mean that the
code following that synchronize_srcu() would end up being unordered with
respect to both the grace period and any pre-existing SRCU read-side
critical sections.

This commit therefore adds an smp_mb() to the end of __synchronize_srcu(),
which prevents this scenario from occurring.

Reported-by: Lance Roy <ldr709@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Lance Roy <ldr709@gmail.com>
---
 kernel/rcu/srcutree.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 94bd6ed43ea3..c1c0ee3cce3b 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -897,6 +897,15 @@ static void __synchronize_srcu(struct srcu_struct *sp, bool do_norm)
 	__call_srcu(sp, &rcu.head, wakeme_after_rcu, do_norm);
 	wait_for_completion(&rcu.completion);
 	destroy_rcu_head_on_stack(&rcu.head);
+
+	/*
+	 * Make sure that later code is ordered after the SRCU grace
+	 * period.  This pairs with the raw_spin_lock_irq_rcu_node()
+	 * in srcu_invoke_callbacks().  Unlike Tree RCU, this is needed
+	 * because the current CPU might have been totally uninvolved with
+	 * (and thus unordered against) that grace period.
+	 */
+	smp_mb();
 }
 
 /**
-- 
2.5.2

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web