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]
Date:	Tue,  6 Sep 2011 11:00:39 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	linux-kernel@...r.kernel.org
Cc:	mingo@...e.hu, laijs@...fujitsu.com, dipankar@...ibm.com,
	akpm@...ux-foundation.org, mathieu.desnoyers@...ymtl.ca,
	josh@...htriplett.org, niv@...ibm.com, tglx@...utronix.de,
	peterz@...radead.org, rostedt@...dmis.org, Valdis.Kletnieks@...edu,
	dhowells@...hat.com, eric.dumazet@...il.com, darren@...art.com,
	patches@...aro.org, "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 45/55] rcu: check for entering dyntick-idle mode while in read-side critical section

CONFIG_RCU_FAST_NO_HZ assumes that all calls to rcu_needs_cpu() are
outside of all RCU read-side critical sections.  This patch adds diagnostic
checks to verify this assumption.

Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
---
 include/linux/rcupdate.h |    3 +++
 kernel/rcutree.c         |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index e86bc28..8d7efc8 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -233,6 +233,8 @@ static inline void destroy_rcu_head_on_stack(struct rcu_head *head)
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 
+#define PROVE_RCU(a) a
+
 extern struct lockdep_map rcu_lock_map;
 # define rcu_read_acquire() \
 		lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_)
@@ -311,6 +313,7 @@ static inline int rcu_read_lock_sched_held(void)
 
 #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
 
+# define PROVE_RCU(a)			do { } while (0)
 # define rcu_read_acquire()		do { } while (0)
 # define rcu_read_release()		do { } while (0)
 # define rcu_read_acquire_bh()		do { } while (0)
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 8455043..743a658 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1786,6 +1786,9 @@ static int rcu_pending(int cpu)
  */
 static int rcu_needs_cpu_quick_check(int cpu)
 {
+	PROVE_RCU(WARN_ON_ONCE(lock_is_held(&rcu_lock_map)));
+	PROVE_RCU(WARN_ON_ONCE(lock_is_held(&rcu_bh_lock_map)));
+	PROVE_RCU(WARN_ON_ONCE(lock_is_held(&rcu_sched_lock_map)));
 	/* RCU callbacks either ready or pending? */
 	return per_cpu(rcu_sched_data, cpu).nxtlist ||
 	       per_cpu(rcu_bh_data, cpu).nxtlist ||
-- 
1.7.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ