lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231107215742.363031-48-ankur.a.arora@oracle.com>
Date:   Tue,  7 Nov 2023 13:57:33 -0800
From:   Ankur Arora <ankur.a.arora@...cle.com>
To:     linux-kernel@...r.kernel.org
Cc:     tglx@...utronix.de, peterz@...radead.org,
        torvalds@...ux-foundation.org, paulmck@...nel.org,
        linux-mm@...ck.org, x86@...nel.org, akpm@...ux-foundation.org,
        luto@...nel.org, bp@...en8.de, dave.hansen@...ux.intel.com,
        hpa@...or.com, mingo@...hat.com, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, willy@...radead.org, mgorman@...e.de,
        jon.grimm@....com, bharata@....com, raghavendra.kt@....com,
        boris.ostrovsky@...cle.com, konrad.wilk@...cle.com,
        jgross@...e.com, andrew.cooper3@...rix.com, mingo@...nel.org,
        bristot@...nel.org, mathieu.desnoyers@...icios.com,
        geert@...ux-m68k.org, glaubitz@...sik.fu-berlin.de,
        anton.ivanov@...bridgegreys.com, mattst88@...il.com,
        krypton@...ich-teichert.org, rostedt@...dmis.org,
        David.Laight@...LAB.COM, richard@....at, mjguzik@...il.com,
        Ankur Arora <ankur.a.arora@...cle.com>,
        Simon Horman <horms@...ge.net.au>,
        Julian Anastasov <ja@....bg>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>
Subject: [RFC PATCH 47/86] rcu: select PREEMPT_RCU if PREEMPT

With PREEMPTION being always-on, some configurations might prefer
the stronger forward-progress guarantees provided by PREEMPT_RCU=n
as compared to PREEMPT_RCU=y.

So, select PREEMPT_RCU=n for PREEMPT_VOLUNTARY and PREEMPT_NONE and
enabling PREEMPT_RCU=y for PREEMPT or PREEMPT_RT.

Note that the preemption model can be changed at runtime (modulo
configurations with ARCH_NO_PREEMPT), but the RCU configuration
is statically compiled.

Cc: Simon Horman <horms@...ge.net.au>
Cc: Julian Anastasov <ja@....bg>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Daniel Borkmann <daniel@...earbox.net>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Ankur Arora <ankur.a.arora@...cle.com>

---
CC-note: Paul had flagged some code that might be impacted
with the proposed RCU changes:

1. My guess is that the IPVS_EST_TICK_CHAINS heuristic remains
   unchanged, but I must defer to the include/net/ip_vs.h people.

2. I need to check with the BPF folks on the BPF verifier's
   definition of BTF_ID(func, rcu_read_unlock_strict).

3. I must defer to others on the mm/pgtable-generic.c file's
   #ifdef that depends on CONFIG_PREEMPT_RCU.

Detailed here:
 https://lore.kernel.org/lkml/a375674b-de27-4965-a4bf-e0679229e28e@paulmck-laptop/

---
 include/linux/rcutree.h | 2 +-
 kernel/rcu/Kconfig      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 126f6b418f6a..75aaa6294421 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -104,7 +104,7 @@ extern int rcu_scheduler_active;
 void rcu_end_inkernel_boot(void);
 bool rcu_inkernel_boot_has_ended(void);
 bool rcu_is_watching(void);
-#ifndef CONFIG_PREEMPTION
+#ifndef CONFIG_PREEMPT
 void rcu_all_qs(void);
 #endif
 
diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig
index bdd7eadb33d8..a808cb29ab7c 100644
--- a/kernel/rcu/Kconfig
+++ b/kernel/rcu/Kconfig
@@ -18,7 +18,7 @@ config TREE_RCU
 
 config PREEMPT_RCU
 	bool
-	default y if PREEMPTION
+	default y if PREEMPT || PREEMPT_RT
 	select TREE_RCU
 	help
 	  This option selects the RCU implementation that is
@@ -31,7 +31,7 @@ config PREEMPT_RCU
 
 config TINY_RCU
 	bool
-	default y if !PREEMPTION && !SMP
+	default y if !PREEMPT && !SMP
 	help
 	  This option selects the RCU implementation that is
 	  designed for UP systems from which real-time response
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ