Skip to content

Commit

Permalink
srcu: Remove Classic SRCU
Browse files Browse the repository at this point in the history
Classic SRCU was only ever intended to be a fallback in case of issues
with Tree/Tiny SRCU, and the latter two are doing quite well in testing.
This commit therefore removes Classic SRCU.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  • Loading branch information
Paul E. McKenney committed Jun 9, 2017
1 parent 7f0cd63 commit bd8cc5a
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 851 deletions.
2 changes: 0 additions & 2 deletions include/linux/srcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ int init_srcu_struct(struct srcu_struct *sp);
#include <linux/srcutiny.h>
#elif defined(CONFIG_TREE_SRCU)
#include <linux/srcutree.h>
#elif defined(CONFIG_CLASSIC_SRCU)
#include <linux/srcuclassic.h>
#elif defined(CONFIG_SRCU)
#error "Unknown SRCU implementation specified to kernel configuration"
#else
Expand Down
100 changes: 0 additions & 100 deletions include/linux/srcuclassic.h

This file was deleted.

21 changes: 2 additions & 19 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -526,32 +526,15 @@ config SRCU
permits arbitrary sleeping or blocking within RCU read-side critical
sections.

config CLASSIC_SRCU
bool "Use v4.11 classic SRCU implementation"
default n
depends on RCU_EXPERT && SRCU
help
This option selects the traditional well-tested classic SRCU
implementation from v4.11, as might be desired for enterprise
Linux distributions. Without this option, the shiny new
Tiny SRCU and Tree SRCU implementations are used instead.
At some point, it is hoped that Tiny SRCU and Tree SRCU
will accumulate enough test time and confidence to allow
Classic SRCU to be dropped entirely.

Say Y if you need a rock-solid SRCU.

Say N if you would like help test Tree SRCU.

config TINY_SRCU
bool
default y if SRCU && TINY_RCU && !CLASSIC_SRCU
default y if SRCU && TINY_RCU
help
This option selects the single-CPU non-preemptible version of SRCU.

config TREE_SRCU
bool
default y if SRCU && !TINY_RCU && !CLASSIC_SRCU
default y if SRCU && !TINY_RCU
help
This option selects the full-fledged version of SRCU.

Expand Down
1 change: 0 additions & 1 deletion kernel/rcu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
KCOV_INSTRUMENT := n

obj-y += update.o sync.o
obj-$(CONFIG_CLASSIC_SRCU) += srcu.o
obj-$(CONFIG_TREE_SRCU) += srcutree.o
obj-$(CONFIG_TINY_SRCU) += srcutiny.o
obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
Expand Down
16 changes: 0 additions & 16 deletions kernel/rcu/rcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,22 +457,6 @@ void srcutorture_get_gp_data(enum rcutorture_type test_type,
struct srcu_struct *sp, int *flags,
unsigned long *gpnum, unsigned long *completed);

#elif defined(CONFIG_CLASSIC_SRCU)

static inline void srcutorture_get_gp_data(enum rcutorture_type test_type,
struct srcu_struct *sp, int *flags,
unsigned long *gpnum,
unsigned long *completed)
{
if (test_type != SRCU_FLAVOR)
return;
*flags = 0;
*completed = sp->completed;
*gpnum = *completed;
if (sp->batch_queue.head || sp->batch_check0.head || sp->batch_check1.head)
(*gpnum)++;
}

#endif

#ifdef CONFIG_TINY_RCU
Expand Down
17 changes: 0 additions & 17 deletions kernel/rcu/rcutorture.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,45 +564,28 @@ static void srcu_torture_stats(void)
int __maybe_unused cpu;
int idx;

#if defined(CONFIG_TREE_SRCU) || defined(CONFIG_CLASSIC_SRCU)
#ifdef CONFIG_TREE_SRCU
idx = srcu_ctlp->srcu_idx & 0x1;
#else /* #ifdef CONFIG_TREE_SRCU */
idx = srcu_ctlp->completed & 0x1;
#endif /* #else #ifdef CONFIG_TREE_SRCU */
pr_alert("%s%s Tree SRCU per-CPU(idx=%d):",
torture_type, TORTURE_FLAG, idx);
for_each_possible_cpu(cpu) {
unsigned long l0, l1;
unsigned long u0, u1;
long c0, c1;
#ifdef CONFIG_TREE_SRCU
struct srcu_data *counts;

counts = per_cpu_ptr(srcu_ctlp->sda, cpu);
u0 = counts->srcu_unlock_count[!idx];
u1 = counts->srcu_unlock_count[idx];
#else /* #ifdef CONFIG_TREE_SRCU */
struct srcu_array *counts;

counts = per_cpu_ptr(srcu_ctlp->per_cpu_ref, cpu);
u0 = counts->unlock_count[!idx];
u1 = counts->unlock_count[idx];
#endif /* #else #ifdef CONFIG_TREE_SRCU */

/*
* Make sure that a lock is always counted if the corresponding
* unlock is counted.
*/
smp_rmb();

#ifdef CONFIG_TREE_SRCU
l0 = counts->srcu_lock_count[!idx];
l1 = counts->srcu_lock_count[idx];
#else /* #ifdef CONFIG_TREE_SRCU */
l0 = counts->lock_count[!idx];
l1 = counts->lock_count[idx];
#endif /* #else #ifdef CONFIG_TREE_SRCU */

c0 = l0 - u0;
c1 = l1 - u1;
Expand Down
Loading

0 comments on commit bd8cc5a

Please sign in to comment.