Skip to contentSkip to conversation

RCU updates for v2.6.27

GIT PULL Ingo Molnar 6 participants 10 messages Jul 14, 2008 – Jul 16, 2008

Subsystems (12)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest RCU git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git core/rcu-for-linus

[ NOTE: due to merge interaction please pull this after
kmemcheck-for-linus. The shortlog is relative to kmemcheck-for-linus. ]

Thanks,

Ingo

------------------>
Franck Bui-Huu (2):
rcu: split list.h and move rcu-protected lists into rculist.h rculist.h: use the rcu API

Huang Weiyi (2):
rcu: remove duplicated include in kernel/rcupreempt_trace.c
rcu: remove duplicated include in kernel/rcupreempt.c

Ingo Molnar (4):
rculist.h: fix include in net/netfilter/nf_conntrack_netlink.c
rcu: fix nf_conntrack_helper.c build bug
Revert "prohibit rcutorture from being compiled into the kernel"
rcutorture: WARN_ON_ONCE(1) when detecting an error

Lai Jiangshan (2):
rcu: remove unused field struct rcu_data::rcu_tasklet rcu classic: update qlen when cpu offline

Paul E. McKenney (12):
rcu: add call_rcu_sched()
rcu: add memory barriers and comments to rcu_check_callbacks()
rcu: add rcu_barrier_sched() and rcu_barrier_bh()
rcu: add call_rcu_sched() and friends to rcutorture
sched: 1Q08 RCU doc update, add call_rcu_sched()
rcu: fix rcu_try_flip_waitack_needed() to prevent grace-period stall RCU, rculist.h: fix list iterators
rcu: make rcutorture more vicious: add stutter feature
rcu: make rcutorture more vicious: reinstate boot-time testing
rcu, rcutorture: make quiescent rcutorture less power-hungry
rcu: make quiescent rcutorture less power-hungry
rcu: make rcutorture even more vicious: invoke RCU readers from irq handlers (timers)

Steven Rostedt (1):
rcupreempt: remove duplicate prototypes

 Documentation/RCU/NMI-RCU.txt                   |    3 +
 Documentation/RCU/RTFP.txt                      |  108 ++++++
 Documentation/RCU/checklist.txt                 |   89 ++++--
 Documentation/RCU/torture.txt                   |   48 ++-
 Documentation/RCU/whatisRCU.txt                 |   58 +++-
 arch/ia64/sn/kernel/irq.c                       |    1 +
 crypto/async_tx/async_tx.c                      |    1 +
 drivers/infiniband/hw/ipath/ipath_verbs.c       |    1 +
 drivers/infiniband/hw/ipath/ipath_verbs_mcast.c |    3 +-
 drivers/net/macvlan.c                           |    2 +-
 include/linux/dcache.h                          |    1 +
 include/linux/list.h                            |  367 --------------------
 include/linux/rcuclassic.h                      |    3 +
 include/linux/rculist.h                         |  369 ++++++++++++++++++++-
 include/linux/rcupdate.h                        |   26 ++-
 include/linux/rcupreempt.h                      |   42 ++-
 init/main.c                                     |    1 +
 kernel/pid.c                                    |    1 +
 kernel/rcuclassic.c                             |   34 ++-
 kernel/rcupdate.c                               |   71 +++--
 kernel/rcupreempt.c                             |  418 ++++++++++++++++++++---
 kernel/rcupreempt_trace.c                       |    1 -
 kernel/rcutorture.c                             |  174 +++++++++-
 kernel/sysctl.c                                 |   13 +
 lib/Kconfig.debug                               |   20 +-
 lib/textsearch.c                                |    1 +
 net/802/psnap.c                                 |    1 +
 net/8021q/vlan.c                                |    1 +
 net/bridge/br_fdb.c                             |    1 +
 net/bridge/br_stp.c                             |    1 +
 net/netfilter/nf_conntrack_helper.c             |    1 +
 net/netfilter/nf_conntrack_netlink.c            |    1 +
 net/netlabel/netlabel_domainhash.c              |    3 +-
 33 files changed, 1341 insertions(+), 524 deletions(-)
Documentation/RCU/NMI-RCU.txt +3 -0
index c64158e..a6d32e6 100644
@@ -93,6 +93,9 @@ Since NMI handlers disable preemption, synchronize_sched() is guaranteed
 not to return until all ongoing NMI handlers exit.  It is therefore safe
 to free up the handler's data as soon as synchronize_sched() returns.
 
+Important note: for this to work, the architecture in question must
+invoke irq_enter() and irq_exit() on NMI entry and exit, respectively.
+
 
 Answer to Quick Quiz
 
Documentation/RCU/RTFP.txt +108 -0

129 lines not on this page · raw message

Documentation/RCU/checklist.txt +60 -29

150 lines not on this page · raw message

Documentation/RCU/torture.txt +33 -15

72 lines not on this page · raw message

Documentation/RCU/whatisRCU.txt +39 -19

84 lines not on this page · raw message

arch/ia64/sn/kernel/irq.c +1 -0
index 53351c3..96c31b4 100644
@@ -11,6 +11,7 @@
 #include <linux/irq.h>
 #include <linux/spinlock.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/arch.h>
 #include <asm/sn/intr.h>
crypto/async_tx/async_tx.c +1 -0
index c6e772f..095c798 100644
@@ -23,6 +23,7 @@
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  *
  */
+#include <linux/rculist.h>
 #include <linux/kernel.h>
 #include <linux/async_tx.h>
 
drivers/infiniband/hw/ipath/ipath_verbs.c +1 -0
index 7779165..38c44de 100644
@@ -35,6 +35,7 @@
 #include <rdma/ib_user_verbs.h>
 #include <linux/io.h>
 #include <linux/utsname.h>
+#include <linux/rculist.h>
 
 #include "ipath_kernel.h"
 #include "ipath_verbs.h"
drivers/infiniband/hw/ipath/ipath_verbs_mcast.c +1 -2
index 9e5abf9..d73e322 100644
@@ -31,8 +31,7 @@
  * SOFTWARE.
  */
 
-#include <linux/list.h>
-#include <linux/rcupdate.h>
+#include <linux/rculist.h>
 
 #include "ipath_verbs.h"
 
drivers/net/macvlan.c +1 -1
index c36a03a..860d75d 100644
@@ -20,7 +20,7 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/string.h>
-#include <linux/list.h>
+#include <linux/rculist.h>
 #include <linux/notifier.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
include/linux/dcache.h +1 -0
index d982eb8..98202c6 100644
@@ -3,6 +3,7 @@
 
 #include <asm/atomic.h>
 #include <linux/list.h>
+#include <linux/rculist.h>
 #include <linux/spinlock.h>
 #include <linux/cache.h>
 #include <linux/rcupdate.h>
include/linux/list.h +0 -367

425 lines not on this page · raw message

include/linux/rcuclassic.h +3 -0
index b3aa05b..8c77490 100644
@@ -151,7 +151,10 @@ extern struct lockdep_map rcu_lock_map;
 
 #define __synchronize_sched() synchronize_rcu()
 
+#define call_rcu_sched(head, func) call_rcu(head, func)
+
 extern void __rcu_init(void);
+#define rcu_init_sched()	do { } while (0)
 extern void rcu_check_callbacks(int cpu, int user);
 extern void rcu_restart_cpu(int cpu);
 
include/linux/rculist.h +368 -1

374 lines not on this page · raw message

include/linux/rcupdate.h +24 -2
index d42dbec..e8b4039 100644
@@ -40,6 +40,7 @@
 #include <linux/cpumask.h>
 #include <linux/seqlock.h>
 #include <linux/lockdep.h>
+#include <linux/completion.h>
 
 /**
  * struct rcu_head - callback structure for use with RCU
@@ -168,6 +169,27 @@ struct rcu_head {
 		(p) = (v); \
 	})
 
+/* Infrastructure to implement the synchronize_() primitives. */
+
+struct rcu_synchronize {
+	struct rcu_head head;
+	struct completion completion;
+};
+
+extern void wakeme_after_rcu(struct rcu_head  *head);
+
+#define synchronize_rcu_xxx(name, func) \
+void name(void) \
+{ \
+	struct rcu_synchronize rcu; \
+	\
+	init_completion(&rcu.completion); \
+	/* Will wake me after RCU finished. */ \
+	func(&rcu.head, wakeme_after_rcu); \
+	/* Wait for it. */ \
+	wait_for_completion(&rcu.completion); \
+}
+
 /**
  * synchronize_sched - block until all CPUs have exited any non-preemptive
  * kernel code sequences.
@@ -224,8 +246,8 @@ extern void call_rcu_bh(struct rcu_head *head,
 /* Exported common interfaces */
 extern void synchronize_rcu(void);
 extern void rcu_barrier(void);
-extern long rcu_batches_completed(void);
-extern long rcu_batches_completed_bh(void);
+extern void rcu_barrier_bh(void);
+extern void rcu_barrier_sched(void);
 
 /* Internal to kernel */
 extern void rcu_init(void);
include/linux/rcupreempt.h +36 -6

72 lines not on this page · raw message

init/main.c +1 -0
index d215b27..a8ff981 100644
@@ -766,6 +766,7 @@ static void __init do_initcalls(void)
  */
 static void __init do_basic_setup(void)
 {
+	rcu_init_sched(); /* needed by module_init stage. */
 	/* drivers will send hotplug events */
 	init_workqueues();
 	usermodehelper_init();
kernel/pid.c +1 -0
index 20d59fa..30bd5d4 100644
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <linux/bootmem.h>
 #include <linux/hash.h>
 #include <linux/pid_namespace.h>
kernel/rcuclassic.c +33 -1
index a38895a..529190c 100644
@@ -387,6 +387,10 @@ static void __rcu_offline_cpu(struct rcu_data *this_rdp,
 	rcu_move_batch(this_rdp, rdp->donelist, rdp->donetail);
 	rcu_move_batch(this_rdp, rdp->curlist, rdp->curtail);
 	rcu_move_batch(this_rdp, rdp->nxtlist, rdp->nxttail);
+
+	local_irq_disable();
+	this_rdp->qlen += rdp->qlen;
+	local_irq_enable();
 }
 
 static void rcu_offline_cpu(int cpu)
@@ -516,10 +520,38 @@ void rcu_check_callbacks(int cpu, int user)
 	if (user ||
 	    (idle_cpu(cpu) && !in_softirq() &&
 				hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
+
+		/*
+		 * Get here if this CPU took its interrupt from user
+		 * mode or from the idle loop, and if this is not a
+		 * nested interrupt.  In this case, the CPU is in
+		 * a quiescent state, so count it.
+		 *
+		 * Also do a memory barrier.  This is needed to handle
+		 * the case where writes from a preempt-disable section
+		 * of code get reordered into schedule() by this CPU's
+		 * write buffer.  The memory barrier makes sure that
+		 * the rcu_qsctr_inc() and rcu_bh_qsctr_inc() are see
+		 * by other CPUs to happen after any such write.
+		 */
+
+		smp_mb();  /* See above block comment. */
 		rcu_qsctr_inc(cpu);
 		rcu_bh_qsctr_inc(cpu);
-	} else if (!in_softirq())
+
+	} else if (!in_softirq()) {
+
+		/*
+		 * Get here if this CPU did not take its interrupt from
+		 * softirq, in other words, if it is not interrupting
+		 * a rcu_bh read-side critical section.  This is an _bh
+		 * critical section, so count it.  The memory barrier
+		 * is needed for the same reason as is the above one.
+		 */
+
+		smp_mb();  /* See above block comment. */
 		rcu_bh_qsctr_inc(cpu);
+	}
 	raise_rcu_softirq();
 }
 
kernel/rcupdate.c +49 -22

121 lines not on this page · raw message

kernel/rcupreempt.c +371 -47

667 lines not on this page · raw message

kernel/rcupreempt_trace.c +0 -1
index 49ac494..5edf82c 100644
@@ -38,7 +38,6 @@
 #include <linux/moduleparam.h>
 #include <linux/percpu.h>
 #include <linux/notifier.h>
-#include <linux/rcupdate.h>
 #include <linux/cpu.h>
 #include <linux/mutex.h>
 #include <linux/rcupreempt_trace.h>
kernel/rcutorture.c +166 -8

356 lines not on this page · raw message

kernel/sysctl.c +13 -0
index dfb6822..ea9c3f7 100644
@@ -84,6 +84,9 @@ extern int maps_protect;
 extern int sysctl_stat_interval;
 extern int latencytop_enabled;
 extern int sysctl_nr_open_min, sysctl_nr_open_max;
+#ifdef CONFIG_RCU_TORTURE_TEST
+extern int rcutorture_runnable;
+#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
 
 /* Constants used for minimum and  maximum */
 #if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM)
@@ -1171,6 +1174,16 @@ static struct ctl_table vm_table[] = {
 		.extra2		= &one,
 	},
 #endif
+#ifdef CONFIG_RCU_TORTURE_TEST
+	{
+		.ctl_name       = CTL_UNNUMBERED,
+		.procname       = "rcutorture_runnable",
+		.data           = &rcutorture_runnable,
+		.maxlen         = sizeof(int),
+		.mode           = 0644,
+		.proc_handler   = &proc_dointvec,
+	},
+#endif
 /*
  * NOTE: do not add new entries to this table unless you have read
  * Documentation/sysctl/ctl_unnumbered.txt
lib/Kconfig.debug +19 -1
index d8b6279..d2f6e3f 100644
@@ -531,16 +531,34 @@ config BOOT_PRINTK_DELAY
 config RCU_TORTURE_TEST
 	tristate "torture tests for RCU"
 	depends on DEBUG_KERNEL
-	depends on m
 	default n
 	help
 	  This option provides a kernel module that runs torture tests
 	  on the RCU infrastructure.  The kernel module may be built
 	  after the fact on the running kernel to be tested, if desired.
 
+	  Say Y here if you want RCU torture tests to be built into
+	  the kernel.
 	  Say M if you want the RCU torture tests to build as a module.
 	  Say N if you are unsure.
 
+config RCU_TORTURE_TEST_RUNNABLE
+	bool "torture tests for RCU runnable by default"
+	depends on RCU_TORTURE_TEST = y
+	default n
+	help
+	  This option provides a way to build the RCU torture tests
+	  directly into the kernel without them starting up at boot
+	  time.  You can use /proc/sys/kernel/rcutorture_runnable
+	  to manually override this setting.  This /proc file is
+	  available only when the RCU torture tests have been built
+	  into the kernel.
+
+	  Say Y here if you want the RCU torture tests to start during
+	  boot (you probably don't).
+	  Say N here if you want the RCU torture tests to start only
+	  after being manually enabled via /proc.
+
 config KPROBES_SANITY_TEST
 	bool "Kprobes sanity tests"
 	depends on DEBUG_KERNEL
lib/textsearch.c +1 -0
index be8bda3..a3e500a 100644
@@ -97,6 +97,7 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <linux/rcupdate.h>
 #include <linux/err.h>
 #include <linux/textsearch.h>
net/802/psnap.c +1 -0
index 31128cb..ea46439 100644
@@ -20,6 +20,7 @@
 #include <linux/mm.h>
 #include <linux/in.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 
 static LIST_HEAD(snap_list);
 static DEFINE_SPINLOCK(snap_lock);
net/8021q/vlan.c +1 -0
index ab2225d..08f14f6 100644
@@ -27,6 +27,7 @@
 #include <linux/mm.h>
 #include <linux/in.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <net/p8022.h>
 #include <net/arp.h>
 #include <linux/rtnetlink.h>
net/bridge/br_fdb.c +1 -0
index 72c5976..142060f 100644
@@ -15,6 +15,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <linux/spinlock.h>
 #include <linux/times.h>
 #include <linux/netdevice.h>
net/bridge/br_stp.c +1 -0
index e38034a..9e96ffc 100644
@@ -13,6 +13,7 @@
  *	2 of the License, or (at your option) any later version.
  */
 #include <linux/kernel.h>
+#include <linux/rculist.h>
 
 #include "br_private.h"
 #include "br_private_stp.h"
net/netfilter/nf_conntrack_helper.c +1 -0
index 7d1b117..8e0b4c8 100644
@@ -20,6 +20,7 @@
 #include <linux/err.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
+#include <linux/rculist.h>
 
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_l3proto.h>
net/netfilter/nf_conntrack_netlink.c +1 -0
index 0edefcf..077bcd2 100644
@@ -18,6 +18,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/rculist.h>
 #include <linux/types.h>
 #include <linux/timer.h>
 #include <linux/skbuff.h>
net/netlabel/netlabel_domainhash.c +1 -2
index 02c2f7c..643c032 100644
@@ -30,8 +30,7 @@
  */
 
 #include <linux/types.h>
-#include <linux/rcupdate.h>
-#include <linux/list.h>
+#include <linux/rculist.h>
 #include <linux/skbuff.h>
 #include <linux/spinlock.h>
 #include <linux/string.h>
#1 lore raw
Quoted 3 lines · Ingo Molnar

[ NOTE: due to merge interaction please pull this after
kmemcheck-for-linus. The shortlog is relative to kmemcheck-for-linus. ]

Hmm. I really wanted to wait with kmemcheck, which is huge and I'm not entirely convinced yet. So now I'll have to wait for these fixes too, for some reason that isn't clear.

Merging stuff for me isn't good, when it then results in me simply not pulling at all.

Linus

#2 lore raw
Quoted 8 lines · Linus Torvalds
Quoted 3 lines · Ingo Molnar

[ NOTE: due to merge interaction please pull this after
kmemcheck-for-linus. The shortlog is relative to kmemcheck-for-linus. ]

Hmm. I really wanted to wait with kmemcheck, which is huge and I'm not entirely convinced yet. So now I'll have to wait for these fixes too, for some reason that isn't clear.

Fair enough, it's easy to fix up, because the tip/core/rcu topic is based in -git (as all the other -tip topics as well), it's just the pull branch that had this ordering. (for convenience only)

I've respun the core/rcu-for-linus branch ontop of your latest - please pull the updated branch from from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git core/rcu-for-linus

See the updated shortlog below.

Quoted 2 lines

Merging stuff for me isn't good, when it then results in me simply not pulling at all.

Yeah, i just took a guess about the order of merging on your side because i sent a ton of pull requests yesterday that had a fair amount of conflicts between them (for which we had well-tested cached conflict resolutions via git-rerere). -tip topics never involve any fundamental forced merge.

If there was forced ordering/basing between topics that would pretty much defeat the primary purpose of a topical setup: choice and line item veto right on the integration side.

Ingo

------------------>
Franck Bui-Huu (2):
rcu: split list.h and move rcu-protected lists into rculist.h rculist.h: use the rcu API

Huang Weiyi (2):
rcu: remove duplicated include in kernel/rcupreempt_trace.c
rcu: remove duplicated include in kernel/rcupreempt.c

Ingo Molnar (4):
rculist.h: fix include in net/netfilter/nf_conntrack_netlink.c
rcu: fix nf_conntrack_helper.c build bug
Revert "prohibit rcutorture from being compiled into the kernel"
rcutorture: WARN_ON_ONCE(1) when detecting an error

Lai Jiangshan (2):
rcu: remove unused field struct rcu_data::rcu_tasklet rcu classic: update qlen when cpu offline

Paul E. McKenney (12):
rcu: add call_rcu_sched()
rcu: add memory barriers and comments to rcu_check_callbacks()
rcu: add rcu_barrier_sched() and rcu_barrier_bh()
rcu: add call_rcu_sched() and friends to rcutorture
sched: 1Q08 RCU doc update, add call_rcu_sched()
rcu: fix rcu_try_flip_waitack_needed() to prevent grace-period stall RCU, rculist.h: fix list iterators
rcu: make rcutorture more vicious: add stutter feature
rcu: make rcutorture more vicious: reinstate boot-time testing
rcu, rcutorture: make quiescent rcutorture less power-hungry
rcu: make quiescent rcutorture less power-hungry
rcu: make rcutorture even more vicious: invoke RCU readers from irq handlers (timers)

Steven Rostedt (1):
rcupreempt: remove duplicate prototypes

 Documentation/RCU/NMI-RCU.txt                   |    3 +
 Documentation/RCU/RTFP.txt                      |  108 ++++++
 Documentation/RCU/checklist.txt                 |   89 ++++--
 Documentation/RCU/torture.txt                   |   48 ++-
 Documentation/RCU/whatisRCU.txt                 |   58 +++-
 arch/ia64/sn/kernel/irq.c                       |    1 +
 crypto/async_tx/async_tx.c                      |    1 +
 drivers/infiniband/hw/ipath/ipath_verbs.c       |    1 +
 drivers/infiniband/hw/ipath/ipath_verbs_mcast.c |    3 +-
 drivers/net/macvlan.c                           |    2 +-
 include/linux/dcache.h                          |    1 +
 include/linux/list.h                            |  367 --------------------
 include/linux/rcuclassic.h                      |    3 +
 include/linux/rculist.h                         |  369 ++++++++++++++++++++-
 include/linux/rcupdate.h                        |   26 ++-
 include/linux/rcupreempt.h                      |   42 ++-
 init/main.c                                     |    1 +
 kernel/pid.c                                    |    1 +
 kernel/rcuclassic.c                             |   34 ++-
 kernel/rcupdate.c                               |   71 +++--
 kernel/rcupreempt.c                             |  418 ++++++++++++++++++++---
 kernel/rcupreempt_trace.c                       |    1 -
 kernel/rcutorture.c                             |  174 +++++++++-
 kernel/sysctl.c                                 |   13 +
 lib/Kconfig.debug                               |   20 +-
 lib/textsearch.c                                |    1 +
 net/802/psnap.c                                 |    1 +
 net/8021q/vlan.c                                |    1 +
 net/bridge/br_fdb.c                             |    1 +
 net/bridge/br_stp.c                             |    1 +
 net/netfilter/nf_conntrack_helper.c             |    1 +
 net/netfilter/nf_conntrack_netlink.c            |    1 +
 net/netlabel/netlabel_domainhash.c              |    3 +-
 33 files changed, 1341 insertions(+), 524 deletions(-)
Documentation/RCU/NMI-RCU.txt +3 -0
index c64158e..a6d32e6 100644
@@ -93,6 +93,9 @@ Since NMI handlers disable preemption, synchronize_sched() is guaranteed
 not to return until all ongoing NMI handlers exit.  It is therefore safe
 to free up the handler's data as soon as synchronize_sched() returns.
 
+Important note: for this to work, the architecture in question must
+invoke irq_enter() and irq_exit() on NMI entry and exit, respectively.
+
 
 Answer to Quick Quiz
 
Documentation/RCU/RTFP.txt +108 -0

129 lines not on this page · raw message

Documentation/RCU/checklist.txt +60 -29

150 lines not on this page · raw message

Documentation/RCU/torture.txt +33 -15

72 lines not on this page · raw message

Documentation/RCU/whatisRCU.txt +39 -19

84 lines not on this page · raw message

arch/ia64/sn/kernel/irq.c +1 -0
index 53351c3..96c31b4 100644
@@ -11,6 +11,7 @@
 #include <linux/irq.h>
 #include <linux/spinlock.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/arch.h>
 #include <asm/sn/intr.h>
crypto/async_tx/async_tx.c +1 -0
index c6e772f..095c798 100644
@@ -23,6 +23,7 @@
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  *
  */
+#include <linux/rculist.h>
 #include <linux/kernel.h>
 #include <linux/async_tx.h>
 
drivers/infiniband/hw/ipath/ipath_verbs.c +1 -0
index 9e23ab0..55c7188 100644
@@ -35,6 +35,7 @@
 #include <rdma/ib_user_verbs.h>
 #include <linux/io.h>
 #include <linux/utsname.h>
+#include <linux/rculist.h>
 
 #include "ipath_kernel.h"
 #include "ipath_verbs.h"
drivers/infiniband/hw/ipath/ipath_verbs_mcast.c +1 -2
index 9e5abf9..d73e322 100644
@@ -31,8 +31,7 @@
  * SOFTWARE.
  */
 
-#include <linux/list.h>
-#include <linux/rcupdate.h>
+#include <linux/rculist.h>
 
 #include "ipath_verbs.h"
 
drivers/net/macvlan.c +1 -1
index c36a03a..860d75d 100644
@@ -20,7 +20,7 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/string.h>
-#include <linux/list.h>
+#include <linux/rculist.h>
 #include <linux/notifier.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
include/linux/dcache.h +1 -0
index d982eb8..98202c6 100644
@@ -3,6 +3,7 @@
 
 #include <asm/atomic.h>
 #include <linux/list.h>
+#include <linux/rculist.h>
 #include <linux/spinlock.h>
 #include <linux/cache.h>
 #include <linux/rcupdate.h>
include/linux/list.h +0 -367

425 lines not on this page · raw message

include/linux/rcuclassic.h +3 -0
index b3aa05b..8c77490 100644
@@ -151,7 +151,10 @@ extern struct lockdep_map rcu_lock_map;
 
 #define __synchronize_sched() synchronize_rcu()
 
+#define call_rcu_sched(head, func) call_rcu(head, func)
+
 extern void __rcu_init(void);
+#define rcu_init_sched()	do { } while (0)
 extern void rcu_check_callbacks(int cpu, int user);
 extern void rcu_restart_cpu(int cpu);
 
include/linux/rculist.h +368 -1

374 lines not on this page · raw message

include/linux/rcupdate.h +24 -2
index d42dbec..e8b4039 100644
@@ -40,6 +40,7 @@
 #include <linux/cpumask.h>
 #include <linux/seqlock.h>
 #include <linux/lockdep.h>
+#include <linux/completion.h>
 
 /**
  * struct rcu_head - callback structure for use with RCU
@@ -168,6 +169,27 @@ struct rcu_head {
 		(p) = (v); \
 	})
 
+/* Infrastructure to implement the synchronize_() primitives. */
+
+struct rcu_synchronize {
+	struct rcu_head head;
+	struct completion completion;
+};
+
+extern void wakeme_after_rcu(struct rcu_head  *head);
+
+#define synchronize_rcu_xxx(name, func) \
+void name(void) \
+{ \
+	struct rcu_synchronize rcu; \
+	\
+	init_completion(&rcu.completion); \
+	/* Will wake me after RCU finished. */ \
+	func(&rcu.head, wakeme_after_rcu); \
+	/* Wait for it. */ \
+	wait_for_completion(&rcu.completion); \
+}
+
 /**
  * synchronize_sched - block until all CPUs have exited any non-preemptive
  * kernel code sequences.
@@ -224,8 +246,8 @@ extern void call_rcu_bh(struct rcu_head *head,
 /* Exported common interfaces */
 extern void synchronize_rcu(void);
 extern void rcu_barrier(void);
-extern long rcu_batches_completed(void);
-extern long rcu_batches_completed_bh(void);
+extern void rcu_barrier_bh(void);
+extern void rcu_barrier_sched(void);
 
 /* Internal to kernel */
 extern void rcu_init(void);
include/linux/rcupreempt.h +36 -6

72 lines not on this page · raw message

init/main.c +1 -0
index f7fb200..a9cc3e0 100644
@@ -758,6 +758,7 @@ static void __init do_initcalls(void)
  */
 static void __init do_basic_setup(void)
 {
+	rcu_init_sched(); /* needed by module_init stage. */
 	/* drivers will send hotplug events */
 	init_workqueues();
 	usermodehelper_init();
kernel/pid.c +1 -0
index 20d59fa..30bd5d4 100644
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <linux/bootmem.h>
 #include <linux/hash.h>
 #include <linux/pid_namespace.h>
kernel/rcuclassic.c +33 -1
index 65c0906..16eeeaa 100644
@@ -387,6 +387,10 @@ static void __rcu_offline_cpu(struct rcu_data *this_rdp,
 	rcu_move_batch(this_rdp, rdp->donelist, rdp->donetail);
 	rcu_move_batch(this_rdp, rdp->curlist, rdp->curtail);
 	rcu_move_batch(this_rdp, rdp->nxtlist, rdp->nxttail);
+
+	local_irq_disable();
+	this_rdp->qlen += rdp->qlen;
+	local_irq_enable();
 }
 
 static void rcu_offline_cpu(int cpu)
@@ -516,10 +520,38 @@ void rcu_check_callbacks(int cpu, int user)
 	if (user ||
 	    (idle_cpu(cpu) && !in_softirq() &&
 				hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
+
+		/*
+		 * Get here if this CPU took its interrupt from user
+		 * mode or from the idle loop, and if this is not a
+		 * nested interrupt.  In this case, the CPU is in
+		 * a quiescent state, so count it.
+		 *
+		 * Also do a memory barrier.  This is needed to handle
+		 * the case where writes from a preempt-disable section
+		 * of code get reordered into schedule() by this CPU's
+		 * write buffer.  The memory barrier makes sure that
+		 * the rcu_qsctr_inc() and rcu_bh_qsctr_inc() are see
+		 * by other CPUs to happen after any such write.
+		 */
+
+		smp_mb();  /* See above block comment. */
 		rcu_qsctr_inc(cpu);
 		rcu_bh_qsctr_inc(cpu);
-	} else if (!in_softirq())
+
+	} else if (!in_softirq()) {
+
+		/*
+		 * Get here if this CPU did not take its interrupt from
+		 * softirq, in other words, if it is not interrupting
+		 * a rcu_bh read-side critical section.  This is an _bh
+		 * critical section, so count it.  The memory barrier
+		 * is needed for the same reason as is the above one.
+		 */
+
+		smp_mb();  /* See above block comment. */
 		rcu_bh_qsctr_inc(cpu);
+	}
 	raise_rcu_softirq();
 }
 
kernel/rcupdate.c +49 -22

121 lines not on this page · raw message

kernel/rcupreempt.c +371 -47

667 lines not on this page · raw message

kernel/rcupreempt_trace.c +0 -1
index 49ac494..5edf82c 100644
@@ -38,7 +38,6 @@
 #include <linux/moduleparam.h>
 #include <linux/percpu.h>
 #include <linux/notifier.h>
-#include <linux/rcupdate.h>
 #include <linux/cpu.h>
 #include <linux/mutex.h>
 #include <linux/rcupreempt_trace.h>
kernel/rcutorture.c +166 -8

356 lines not on this page · raw message

kernel/sysctl.c +13 -0
index 0d562d6..6b16e16 100644
@@ -83,6 +83,9 @@ extern int maps_protect;
 extern int sysctl_stat_interval;
 extern int latencytop_enabled;
 extern int sysctl_nr_open_min, sysctl_nr_open_max;
+#ifdef CONFIG_RCU_TORTURE_TEST
+extern int rcutorture_runnable;
+#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
 
 /* Constants used for minimum and  maximum */
 #if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM)
@@ -820,6 +823,16 @@ static struct ctl_table kern_table[] = {
 		.child		= key_sysctls,
 	},
 #endif
+#ifdef CONFIG_RCU_TORTURE_TEST
+	{
+		.ctl_name       = CTL_UNNUMBERED,
+		.procname       = "rcutorture_runnable",
+		.data           = &rcutorture_runnable,
+		.maxlen         = sizeof(int),
+		.mode           = 0644,
+		.proc_handler   = &proc_dointvec,
+	},
+#endif
 /*
  * NOTE: do not add new entries to this table unless you have read
  * Documentation/sysctl/ctl_unnumbered.txt
lib/Kconfig.debug +19 -1
index c459e85..df27132 100644
@@ -530,16 +530,34 @@ config BOOT_PRINTK_DELAY
 config RCU_TORTURE_TEST
 	tristate "torture tests for RCU"
 	depends on DEBUG_KERNEL
-	depends on m
 	default n
 	help
 	  This option provides a kernel module that runs torture tests
 	  on the RCU infrastructure.  The kernel module may be built
 	  after the fact on the running kernel to be tested, if desired.
 
+	  Say Y here if you want RCU torture tests to be built into
+	  the kernel.
 	  Say M if you want the RCU torture tests to build as a module.
 	  Say N if you are unsure.
 
+config RCU_TORTURE_TEST_RUNNABLE
+	bool "torture tests for RCU runnable by default"
+	depends on RCU_TORTURE_TEST = y
+	default n
+	help
+	  This option provides a way to build the RCU torture tests
+	  directly into the kernel without them starting up at boot
+	  time.  You can use /proc/sys/kernel/rcutorture_runnable
+	  to manually override this setting.  This /proc file is
+	  available only when the RCU torture tests have been built
+	  into the kernel.
+
+	  Say Y here if you want the RCU torture tests to start during
+	  boot (you probably don't).
+	  Say N here if you want the RCU torture tests to start only
+	  after being manually enabled via /proc.
+
 config KPROBES_SANITY_TEST
 	bool "Kprobes sanity tests"
 	depends on DEBUG_KERNEL
lib/textsearch.c +1 -0
index be8bda3..a3e500a 100644
@@ -97,6 +97,7 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <linux/rcupdate.h>
 #include <linux/err.h>
 #include <linux/textsearch.h>
net/802/psnap.c +1 -0
index 31128cb..ea46439 100644
@@ -20,6 +20,7 @@
 #include <linux/mm.h>
 #include <linux/in.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 
 static LIST_HEAD(snap_list);
 static DEFINE_SPINLOCK(snap_lock);
net/8021q/vlan.c +1 -0
index ab2225d..08f14f6 100644
@@ -27,6 +27,7 @@
 #include <linux/mm.h>
 #include <linux/in.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <net/p8022.h>
 #include <net/arp.h>
 #include <linux/rtnetlink.h>
net/bridge/br_fdb.c +1 -0
index 72c5976..142060f 100644
@@ -15,6 +15,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/rculist.h>
 #include <linux/spinlock.h>
 #include <linux/times.h>
 #include <linux/netdevice.h>
net/bridge/br_stp.c +1 -0
index e38034a..9e96ffc 100644
@@ -13,6 +13,7 @@
  *	2 of the License, or (at your option) any later version.
  */
 #include <linux/kernel.h>
+#include <linux/rculist.h>
 
 #include "br_private.h"
 #include "br_private_stp.h"
net/netfilter/nf_conntrack_helper.c +1 -0
index 7d1b117..8e0b4c8 100644
@@ -20,6 +20,7 @@
 #include <linux/err.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
+#include <linux/rculist.h>
 
 #include <net/netfilter/nf_conntrack.h>
 #include <net/netfilter/nf_conntrack_l3proto.h>
net/netfilter/nf_conntrack_netlink.c +1 -0
index 0edefcf..077bcd2 100644
@@ -18,6 +18,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/rculist.h>
 #include <linux/types.h>
 #include <linux/timer.h>
 #include <linux/skbuff.h>
net/netlabel/netlabel_domainhash.c +1 -2
index 02c2f7c..643c032 100644
@@ -30,8 +30,7 @@
  */
 
 #include <linux/types.h>
-#include <linux/rcupdate.h>
-#include <linux/list.h>
+#include <linux/rculist.h>
 #include <linux/skbuff.h>
 #include <linux/spinlock.h>
 #include <linux/string.h>
#3 lore raw
In reply to Linus Torvalds
Quoted 10 lines · Linus Torvalds
Quoted 3 lines · Ingo Molnar

[ NOTE: due to merge interaction please pull this after
kmemcheck-for-linus. The shortlog is relative to kmemcheck-for-linus. ]

Hmm. I really wanted to wait with kmemcheck, which is huge and I'm not entirely convinced yet. So now I'll have to wait for these fixes too, for some reason that isn't clear.

Hey, give us some credit; at least it's disabled by default ;-)

But yeah, I'll continue to improve it and hopefully get it in better shape for next time, especially with regards to SMP support. Maybe we can finally have Andrew's review too, if he's not too busy giving all these talks and whatnot. Some of the things we've actually fixed up since last time include impact on the slab code, CodingStyle/checkpatch issues, and the splitting the huge single file of code into its own directory to make it more manageable. Oh, and I believe 64-bit support is new as well.

Thanks,

Vegard

Signature · 4 lines
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036
maintainer
#6 lore raw
In reply to Linus Torvalds
Quoted 2 lines · On Tue, 15 Jul 2008 10:38:27 -0700 (PDT) Linus Torvalds…

Hmm. I really wanted to wait with kmemcheck, which is huge and I'm not entirely convinced yet.

Any particular concerns?

I haven't looked at it yet, and I wouldn't mind seeing it go past in changelog+patch form again for reviewing pleasure.

#7 lore raw
Quoted 7 lines · Andrew Morton
Quoted 2 lines · On Tue, 15 Jul 2008 10:38:27 -0700 (PDT) Linus Torvalds…

Hmm. I really wanted to wait with kmemcheck, which is huge and I'm not entirely convinced yet.

Any particular concerns?

It's big, complex and looks fragile. And it reports lots of false positives, with big warnings to people to generally not use or make reports about itit unless they are already experts. So it looks like something pretty specific.

I also want to feel like it actually has been helpful.

But the _real_ issue is that I'm simply merging about 20+ trees per day, and I want to know what I merge, and I want to feel comfy about it as I merge it.

And kmemcheck didn't make me do that, adn I didn't feel like I had the time to really look at it any closer. So while I might merge it before the merge window is open, there's simply no way I'll merge it today (and almost certainly not this week, considering that I'll be on the coast for a long weekend).

IOW, I'm quite busy enough merging _other_ things, and handling the fallout from those other merges (mostly the firmware discussion ;). So I'm simply not interested in kmemcheck right now - I have enough to keep me busy.

So kmemcheck in no way made me go: "ok, we _need_ to merge this", and at the same time it's biggish and scary and complex enough that I felt I needed to take the time to think about it - which I don't feel I have right now.

The RCU thing, on the other hand, looked like a no-brainer from a merge standpoint. However, since it had merged kmemcheck, it didn't get merged either. I'll take a look at Ingo's second version that didn't tie the two together.

This is why tying things together doesn't necessarily work, and why I told Ingo that I'm not pulling the RCU thing just because I wasn't ready to pull kmemcheck.

Linus

#8 lore raw

Hi Linus,

Quoted 2 lines · On Tue, 15 Jul 2008 10:38:27 -0700 (PDT) Linus Torvalds…
Quoted 2 lines
Quoted 2 lines

Hmm. I really wanted to wait with kmemcheck, which is huge and I'm not entirely convinced yet.

Quoted 1 line · Andrew Morton
Quoted 1 line

Any particular concerns?

Quoted 6 lines · Linus Torvalds

It's big, complex and looks fragile. And it reports lots of false positives, with big warnings to people to generally not use or make reports about itit unless they are already experts. So it looks like something pretty specific.

I also want to feel like it actually has been helpful.

Besides catching reads to uninitialized memory, kmemcheck detects use-after-free now and can be extended to catch red-zone overwrites *as they happen* which will make debugging kernel memory corruptions much easier for everybody.

There are now three commits in your tree that fix a real bug reported by kmemcheck: 8410565f540db87ca938f56f92780d251e4f157d ("ACPICA: Fix for access to deleted object <regression>"), adeed48090fc370afa0db8d007748ee72a40b578 ("rc80211_pid: Fix fast_start parameter handling"), and 62f75532b583c03840f31e40386ce2df73be9ca0 ("slub: Initialize per-cpu stats").

So I think it has been helpful and that the infrastructure it adds is valuable for future debugging aids.

Pekka

#9 lore raw
Quoted 6 lines · Pekka Enberg

There are now three commits in your tree that fix a real bug reported by kmemcheck: 8410565f540db87ca938f56f92780d251e4f157d ("ACPICA: Fix for access to deleted object <regression>"), adeed48090fc370afa0db8d007748ee72a40b578 ("rc80211_pid: Fix fast_start parameter handling"), and 62f75532b583c03840f31e40386ce2df73be9ca0 ("slub: Initialize per-cpu stats").

there's a fourth one that i found via kmemcheck and which got fixed by Jens but the commit log doesnt mention that it was found via kmemcheck:

 | commit 63a7138671c50a6f2c27bbd1a308dc75967062a3
 | Author: Jens Axboe <[email protected]>
 | Date:   Fri Feb 8 12:41:03 2008 +0100
 |
 |     block: fixup rq_init() a bit
Quoted 2 lines

So I think it has been helpful and that the infrastructure it adds is valuable for future debugging aids.

even if it was not finding any bugs it would be useful to us - it has already cleaned up a few dusty aspects of x86 code. (it might be similar for SLUB)

Oh, and kmemcheck got Vegard to hack Linux ;-)

Ingo

#4 lore raw
In reply to Vegard Nossum
Quoted 9 lines · Vegard Nossum

But yeah, I'll continue to improve it and hopefully get it in better shape for next time, especially with regards to SMP support. Maybe we can finally have Andrew's review too, if he's not too busy giving all these talks and whatnot. Some of the things we've actually fixed up since last time include impact on the slab code, CodingStyle/checkpatch issues, and the splitting the huge single file of code into its own directory to make it more manageable. Oh, and I believe 64-bit support is new as well.

Have the network (or likely general) IO false positives be fixed yet? That seemed like the largest design misfeature last time I looked. I suspect it needs integration into the PCI-DMA API.

-Andi

#5 lore raw
Quoted 11 lines · Andi Kleen
Quoted 9 lines · Vegard Nossum

But yeah, I'll continue to improve it and hopefully get it in better shape for next time, especially with regards to SMP support. Maybe we can finally have Andrew's review too, if he's not too busy giving all these talks and whatnot. Some of the things we've actually fixed up since last time include impact on the slab code, CodingStyle/checkpatch issues, and the splitting the huge single file of code into its own directory to make it more manageable. Oh, and I believe 64-bit support is new as well.

Quoted 3 lines

Have the network (or likely general) IO false positives be fixed yet? That seemed like the largest design misfeature last time I looked. I suspect it needs integration into the PCI-DMA API.

They haven't.

Integration into DMA API would be really nice (and a quite logical thing to do). I will take a look at it... (Unless you beat me to it with a patch, of course ;-))

Thanks,

Vegard

Signature · 4 lines
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036