Skip to content

Commit bd8cc5a

Browse files
committed
srcu: Remove Classic SRCU
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>
1 parent 7f0cd63 commit bd8cc5a

10 files changed

Lines changed: 2 additions & 851 deletions

File tree

‎include/linux/srcu.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ int init_srcu_struct(struct srcu_struct *sp);
6060
#include <linux/srcutiny.h>
6161
#elif defined(CONFIG_TREE_SRCU)
6262
#include <linux/srcutree.h>
63-
#elif defined(CONFIG_CLASSIC_SRCU)
64-
#include <linux/srcuclassic.h>
6563
#elif defined(CONFIG_SRCU)
6664
#error "Unknown SRCU implementation specified to kernel configuration"
6765
#else

‎include/linux/srcuclassic.h‎

Lines changed: 0 additions & 100 deletions
This file was deleted.

‎init/Kconfig‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -526,32 +526,15 @@ config SRCU
526526
permits arbitrary sleeping or blocking within RCU read-side critical
527527
sections.
528528

529-
config CLASSIC_SRCU
530-
bool "Use v4.11 classic SRCU implementation"
531-
default n
532-
depends on RCU_EXPERT && SRCU
533-
help
534-
This option selects the traditional well-tested classic SRCU
535-
implementation from v4.11, as might be desired for enterprise
536-
Linux distributions. Without this option, the shiny new
537-
Tiny SRCU and Tree SRCU implementations are used instead.
538-
At some point, it is hoped that Tiny SRCU and Tree SRCU
539-
will accumulate enough test time and confidence to allow
540-
Classic SRCU to be dropped entirely.
541-
542-
Say Y if you need a rock-solid SRCU.
543-
544-
Say N if you would like help test Tree SRCU.
545-
546529
config TINY_SRCU
547530
bool
548-
default y if SRCU && TINY_RCU && !CLASSIC_SRCU
531+
default y if SRCU && TINY_RCU
549532
help
550533
This option selects the single-CPU non-preemptible version of SRCU.
551534

552535
config TREE_SRCU
553536
bool
554-
default y if SRCU && !TINY_RCU && !CLASSIC_SRCU
537+
default y if SRCU && !TINY_RCU
555538
help
556539
This option selects the full-fledged version of SRCU.
557540

‎kernel/rcu/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
KCOV_INSTRUMENT := n
44

55
obj-y += update.o sync.o
6-
obj-$(CONFIG_CLASSIC_SRCU) += srcu.o
76
obj-$(CONFIG_TREE_SRCU) += srcutree.o
87
obj-$(CONFIG_TINY_SRCU) += srcutiny.o
98
obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o

‎kernel/rcu/rcu.h‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -457,22 +457,6 @@ void srcutorture_get_gp_data(enum rcutorture_type test_type,
457457
struct srcu_struct *sp, int *flags,
458458
unsigned long *gpnum, unsigned long *completed);
459459

460-
#elif defined(CONFIG_CLASSIC_SRCU)
461-
462-
static inline void srcutorture_get_gp_data(enum rcutorture_type test_type,
463-
struct srcu_struct *sp, int *flags,
464-
unsigned long *gpnum,
465-
unsigned long *completed)
466-
{
467-
if (test_type != SRCU_FLAVOR)
468-
return;
469-
*flags = 0;
470-
*completed = sp->completed;
471-
*gpnum = *completed;
472-
if (sp->batch_queue.head || sp->batch_check0.head || sp->batch_check1.head)
473-
(*gpnum)++;
474-
}
475-
476460
#endif
477461

478462
#ifdef CONFIG_TINY_RCU

‎kernel/rcu/rcutorture.c‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -564,45 +564,28 @@ static void srcu_torture_stats(void)
564564
int __maybe_unused cpu;
565565
int idx;
566566

567-
#if defined(CONFIG_TREE_SRCU) || defined(CONFIG_CLASSIC_SRCU)
568567
#ifdef CONFIG_TREE_SRCU
569568
idx = srcu_ctlp->srcu_idx & 0x1;
570-
#else /* #ifdef CONFIG_TREE_SRCU */
571-
idx = srcu_ctlp->completed & 0x1;
572-
#endif /* #else #ifdef CONFIG_TREE_SRCU */
573569
pr_alert("%s%s Tree SRCU per-CPU(idx=%d):",
574570
torture_type, TORTURE_FLAG, idx);
575571
for_each_possible_cpu(cpu) {
576572
unsigned long l0, l1;
577573
unsigned long u0, u1;
578574
long c0, c1;
579-
#ifdef CONFIG_TREE_SRCU
580575
struct srcu_data *counts;
581576

582577
counts = per_cpu_ptr(srcu_ctlp->sda, cpu);
583578
u0 = counts->srcu_unlock_count[!idx];
584579
u1 = counts->srcu_unlock_count[idx];
585-
#else /* #ifdef CONFIG_TREE_SRCU */
586-
struct srcu_array *counts;
587-
588-
counts = per_cpu_ptr(srcu_ctlp->per_cpu_ref, cpu);
589-
u0 = counts->unlock_count[!idx];
590-
u1 = counts->unlock_count[idx];
591-
#endif /* #else #ifdef CONFIG_TREE_SRCU */
592580

593581
/*
594582
* Make sure that a lock is always counted if the corresponding
595583
* unlock is counted.
596584
*/
597585
smp_rmb();
598586

599-
#ifdef CONFIG_TREE_SRCU
600587
l0 = counts->srcu_lock_count[!idx];
601588
l1 = counts->srcu_lock_count[idx];
602-
#else /* #ifdef CONFIG_TREE_SRCU */
603-
l0 = counts->lock_count[!idx];
604-
l1 = counts->lock_count[idx];
605-
#endif /* #else #ifdef CONFIG_TREE_SRCU */
606589

607590
c0 = l0 - u0;
608591
c1 = l1 - u1;

0 commit comments

Comments
 (0)