aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-26 12:47:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-26 12:47:56 -0500
commit3386c05bdbd3e60ca7158253442f0a00133db28e (patch)
tree19e48f0352e65eb83a0e922fb75528ed39f44ebd
parent1e70c7f7a9d4a3d2cc78b40e1d7768d99cd79899 (diff)
parent6552ebae25ffd57574c6e72d17fce67fea08b918 (diff)
Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: debugobjects: add and use INIT_WORK_ON_STACK rcu: remove duplicate CONFIG_RCU_CPU_STALL_DETECTOR relay: fix lock imbalance in relay_late_setup_files oprofile: fix uninitialized use of struct op_entry rcu: move Kconfig menu softlock: fix false panic which can occur if softlockup_thresh is reduced rcu: add __cpuinit to rcu_init_percpu_data()
-rw-r--r--arch/x86/kernel/hpet.c1
-rw-r--r--drivers/oprofile/cpu_buffer.c5
-rw-r--r--drivers/oprofile/cpu_buffer.h7
-rw-r--r--include/linux/sched.h3
-rw-r--r--include/linux/workqueue.h6
-rw-r--r--init/Kconfig179
-rw-r--r--kernel/rcuclassic.c2
-rw-r--r--kernel/rcutree.c2
-rw-r--r--kernel/relay.c4
-rw-r--r--kernel/softlockup.c9
-rw-r--r--kernel/sysctl.c2
-rw-r--r--lib/Kconfig.debug13
12 files changed, 129 insertions, 104 deletions
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index bb2e0f0975ae..64d5ad0b8add 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -633,6 +633,7 @@ static int hpet_cpuhp_notify(struct notifier_block *n,
633 /* FIXME: add schedule_work_on() */ 633 /* FIXME: add schedule_work_on() */
634 schedule_delayed_work_on(cpu, &work.work, 0); 634 schedule_delayed_work_on(cpu, &work.work, 0);
635 wait_for_completion(&work.complete); 635 wait_for_completion(&work.complete);
636 destroy_timer_on_stack(&work.work.timer);
636 break; 637 break;
637 case CPU_DEAD: 638 case CPU_DEAD:
638 if (hdev) { 639 if (hdev) {
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index 2e03b6d796d3..e76d715e4342 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -393,16 +393,21 @@ oprofile_write_reserve(struct op_entry *entry, struct pt_regs * const regs,
393 return; 393 return;
394 394
395fail: 395fail:
396 entry->event = NULL;
396 cpu_buf->sample_lost_overflow++; 397 cpu_buf->sample_lost_overflow++;
397} 398}
398 399
399int oprofile_add_data(struct op_entry *entry, unsigned long val) 400int oprofile_add_data(struct op_entry *entry, unsigned long val)
400{ 401{
402 if (!entry->event)
403 return 0;
401 return op_cpu_buffer_add_data(entry, val); 404 return op_cpu_buffer_add_data(entry, val);
402} 405}
403 406
404int oprofile_write_commit(struct op_entry *entry) 407int oprofile_write_commit(struct op_entry *entry)
405{ 408{
409 if (!entry->event)
410 return -EINVAL;
406 return op_cpu_buffer_write_commit(entry); 411 return op_cpu_buffer_write_commit(entry);
407} 412}
408 413
diff --git a/drivers/oprofile/cpu_buffer.h b/drivers/oprofile/cpu_buffer.h
index 63f81c44846a..272995d20293 100644
--- a/drivers/oprofile/cpu_buffer.h
+++ b/drivers/oprofile/cpu_buffer.h
@@ -66,6 +66,13 @@ static inline void op_cpu_buffer_reset(int cpu)
66 cpu_buf->last_task = NULL; 66 cpu_buf->last_task = NULL;
67} 67}
68 68
69/*
70 * op_cpu_buffer_add_data() and op_cpu_buffer_write_commit() may be
71 * called only if op_cpu_buffer_write_reserve() did not return NULL or
72 * entry->event != NULL, otherwise entry->size or entry->event will be
73 * used uninitialized.
74 */
75
69struct op_sample 76struct op_sample
70*op_cpu_buffer_write_reserve(struct op_entry *entry, unsigned long size); 77*op_cpu_buffer_write_reserve(struct op_entry *entry, unsigned long size);
71int op_cpu_buffer_write_commit(struct op_entry *entry); 78int op_cpu_buffer_write_commit(struct op_entry *entry);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index c20943eabb4c..02e16d207304 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -293,6 +293,9 @@ extern void sched_show_task(struct task_struct *p);
293extern void softlockup_tick(void); 293extern void softlockup_tick(void);
294extern void touch_softlockup_watchdog(void); 294extern void touch_softlockup_watchdog(void);
295extern void touch_all_softlockup_watchdogs(void); 295extern void touch_all_softlockup_watchdogs(void);
296extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write,
297 struct file *filp, void __user *buffer,
298 size_t *lenp, loff_t *ppos);
296extern unsigned int softlockup_panic; 299extern unsigned int softlockup_panic;
297extern unsigned long sysctl_hung_task_check_count; 300extern unsigned long sysctl_hung_task_check_count;
298extern unsigned long sysctl_hung_task_timeout_secs; 301extern unsigned long sysctl_hung_task_timeout_secs;
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 47151c8495aa..3cd51e579ab1 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -130,6 +130,12 @@ struct execute_work {
130 init_timer_deferrable(&(_work)->timer); \ 130 init_timer_deferrable(&(_work)->timer); \
131 } while (0) 131 } while (0)
132 132
133#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \
134 do { \
135 INIT_WORK(&(_work)->work, (_func)); \
136 init_timer_on_stack(&(_work)->timer); \
137 } while (0)
138
133/** 139/**
134 * work_pending - Find out whether a work item is currently pending 140 * work_pending - Find out whether a work item is currently pending
135 * @work: The work item in question 141 * @work: The work item in question
diff --git a/init/Kconfig b/init/Kconfig
index 2af83825634e..3be35f3a001b 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -238,6 +238,98 @@ config AUDIT_TREE
238 def_bool y 238 def_bool y
239 depends on AUDITSYSCALL && INOTIFY 239 depends on AUDITSYSCALL && INOTIFY
240 240
241menu "RCU Subsystem"
242
243choice
244 prompt "RCU Implementation"
245 default CLASSIC_RCU
246
247config CLASSIC_RCU
248 bool "Classic RCU"
249 help
250 This option selects the classic RCU implementation that is
251 designed for best read-side performance on non-realtime
252 systems.
253
254 Select this option if you are unsure.
255
256config TREE_RCU
257 bool "Tree-based hierarchical RCU"
258 help
259 This option selects the RCU implementation that is
260 designed for very large SMP system with hundreds or
261 thousands of CPUs.
262
263config PREEMPT_RCU
264 bool "Preemptible RCU"
265 depends on PREEMPT
266 help
267 This option reduces the latency of the kernel by making certain
268 RCU sections preemptible. Normally RCU code is non-preemptible, if
269 this option is selected then read-only RCU sections become
270 preemptible. This helps latency, but may expose bugs due to
271 now-naive assumptions about each RCU read-side critical section
272 remaining on a given CPU through its execution.
273
274endchoice
275
276config RCU_TRACE
277 bool "Enable tracing for RCU"
278 depends on TREE_RCU || PREEMPT_RCU
279 help
280 This option provides tracing in RCU which presents stats
281 in debugfs for debugging RCU implementation.
282
283 Say Y here if you want to enable RCU tracing
284 Say N if you are unsure.
285
286config RCU_FANOUT
287 int "Tree-based hierarchical RCU fanout value"
288 range 2 64 if 64BIT
289 range 2 32 if !64BIT
290 depends on TREE_RCU
291 default 64 if 64BIT
292 default 32 if !64BIT
293 help
294 This option controls the fanout of hierarchical implementations
295 of RCU, allowing RCU to work efficiently on machines with
296 large numbers of CPUs. This value must be at least the cube
297 root of NR_CPUS, which allows NR_CPUS up to 32,768 for 32-bit
298 systems and up to 262,144 for 64-bit systems.
299
300 Select a specific number if testing RCU itself.
301 Take the default if unsure.
302
303config RCU_FANOUT_EXACT
304 bool "Disable tree-based hierarchical RCU auto-balancing"
305 depends on TREE_RCU
306 default n
307 help
308 This option forces use of the exact RCU_FANOUT value specified,
309 regardless of imbalances in the hierarchy. This is useful for
310 testing RCU itself, and might one day be useful on systems with
311 strong NUMA behavior.
312
313 Without RCU_FANOUT_EXACT, the code will balance the hierarchy.
314
315 Say N if unsure.
316
317config TREE_RCU_TRACE
318 def_bool RCU_TRACE && TREE_RCU
319 select DEBUG_FS
320 help
321 This option provides tracing for the TREE_RCU implementation,
322 permitting Makefile to trivially select kernel/rcutree_trace.c.
323
324config PREEMPT_RCU_TRACE
325 def_bool RCU_TRACE && PREEMPT_RCU
326 select DEBUG_FS
327 help
328 This option provides tracing for the PREEMPT_RCU implementation,
329 permitting Makefile to trivially select kernel/rcupreempt_trace.c.
330
331endmenu # "RCU Subsystem"
332
241config IKCONFIG 333config IKCONFIG
242 tristate "Kernel .config support" 334 tristate "Kernel .config support"
243 ---help--- 335 ---help---
@@ -972,90 +1064,3 @@ source "block/Kconfig"
972config PREEMPT_NOTIFIERS 1064config PREEMPT_NOTIFIERS
973 bool 1065 bool
974 1066
975choice
976 prompt "RCU Implementation"
977 default CLASSIC_RCU
978
979config CLASSIC_RCU
980 bool "Classic RCU"
981 help
982 This option selects the classic RCU implementation that is
983 designed for best read-side performance on non-realtime
984 systems.
985
986 Select this option if you are unsure.
987
988config TREE_RCU
989 bool "Tree-based hierarchical RCU"
990 help
991 This option selects the RCU implementation that is
992 designed for very large SMP system with hundreds or
993 thousands of CPUs.
994
995config PREEMPT_RCU
996 bool "Preemptible RCU"
997 depends on PREEMPT
998 help
999 This option reduces the latency of the kernel by making certain
1000 RCU sections preemptible. Normally RCU code is non-preemptible, if
1001 this option is selected then read-only RCU sections become
1002 preemptible. This helps latency, but may expose bugs due to
1003 now-naive assumptions about each RCU read-side critical section
1004 remaining on a given CPU through its execution.
1005
1006endchoice
1007
1008config RCU_TRACE
1009 bool "Enable tracing for RCU"
1010 depends on TREE_RCU || PREEMPT_RCU
1011 help
1012 This option provides tracing in RCU which presents stats
1013 in debugfs for debugging RCU implementation.
1014
1015 Say Y here if you want to enable RCU tracing
1016 Say N if you are unsure.
1017
1018config RCU_FANOUT
1019 int "Tree-based hierarchical RCU fanout value"
1020 range 2 64 if 64BIT
1021 range 2 32 if !64BIT
1022 depends on TREE_RCU
1023 default 64 if 64BIT
1024 default 32 if !64BIT
1025 help
1026 This option controls the fanout of hierarchical implementations
1027 of RCU, allowing RCU to work efficiently on machines with
1028 large numbers of CPUs. This value must be at least the cube
1029 root of NR_CPUS, which allows NR_CPUS up to 32,768 for 32-bit
1030 systems and up to 262,144 for 64-bit systems.
1031
1032 Select a specific number if testing RCU itself.
1033 Take the default if unsure.
1034
1035config RCU_FANOUT_EXACT
1036 bool "Disable tree-based hierarchical RCU auto-balancing"
1037 depends on TREE_RCU
1038 default n
1039 help
1040 This option forces use of the exact RCU_FANOUT value specified,
1041 regardless of imbalances in the hierarchy. This is useful for
1042 testing RCU itself, and might one day be useful on systems with
1043 strong NUMA behavior.
1044
1045 Without RCU_FANOUT_EXACT, the code will balance the hierarchy.
1046
1047 Say N if unsure.
1048
1049config TREE_RCU_TRACE
1050 def_bool RCU_TRACE && TREE_RCU
1051 select DEBUG_FS
1052 help
1053 This option provides tracing for the TREE_RCU implementation,
1054 permitting Makefile to trivially select kernel/rcutree_trace.c.
1055
1056config PREEMPT_RCU_TRACE
1057 def_bool RCU_TRACE && PREEMPT_RCU
1058 select DEBUG_FS
1059 help
1060 This option provides tracing for the PREEMPT_RCU implementation,
1061 permitting Makefile to trivially select kernel/rcupreempt_trace.c.
diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c
index 490934fc7ac3..bd5a9003497c 100644
--- a/kernel/rcuclassic.c
+++ b/kernel/rcuclassic.c
@@ -716,7 +716,7 @@ void rcu_check_callbacks(int cpu, int user)
716 raise_rcu_softirq(); 716 raise_rcu_softirq();
717} 717}
718 718
719static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp, 719static void __cpuinit rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
720 struct rcu_data *rdp) 720 struct rcu_data *rdp)
721{ 721{
722 unsigned long flags; 722 unsigned long flags;
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index f2d8638e6c60..b2fd602a6f6f 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1314,7 +1314,7 @@ int rcu_needs_cpu(int cpu)
1314 * access due to the fact that this CPU cannot possibly have any RCU 1314 * access due to the fact that this CPU cannot possibly have any RCU
1315 * callbacks in flight yet. 1315 * callbacks in flight yet.
1316 */ 1316 */
1317static void 1317static void __cpuinit
1318rcu_init_percpu_data(int cpu, struct rcu_state *rsp) 1318rcu_init_percpu_data(int cpu, struct rcu_state *rsp)
1319{ 1319{
1320 unsigned long flags; 1320 unsigned long flags;
diff --git a/kernel/relay.c b/kernel/relay.c
index 09ac2008f77b..9d79b7854fa6 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -663,8 +663,10 @@ int relay_late_setup_files(struct rchan *chan,
663 663
664 mutex_lock(&relay_channels_mutex); 664 mutex_lock(&relay_channels_mutex);
665 /* Is chan already set up? */ 665 /* Is chan already set up? */
666 if (unlikely(chan->has_base_filename)) 666 if (unlikely(chan->has_base_filename)) {
667 mutex_unlock(&relay_channels_mutex);
667 return -EEXIST; 668 return -EEXIST;
669 }
668 chan->has_base_filename = 1; 670 chan->has_base_filename = 1;
669 chan->parent = parent; 671 chan->parent = parent;
670 curr_cpu = get_cpu(); 672 curr_cpu = get_cpu();
diff --git a/kernel/softlockup.c b/kernel/softlockup.c
index d9188c66278a..85d5a2455103 100644
--- a/kernel/softlockup.c
+++ b/kernel/softlockup.c
@@ -16,6 +16,7 @@
16#include <linux/lockdep.h> 16#include <linux/lockdep.h>
17#include <linux/notifier.h> 17#include <linux/notifier.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/sysctl.h>
19 20
20#include <asm/irq_regs.h> 21#include <asm/irq_regs.h>
21 22
@@ -88,6 +89,14 @@ void touch_all_softlockup_watchdogs(void)
88} 89}
89EXPORT_SYMBOL(touch_all_softlockup_watchdogs); 90EXPORT_SYMBOL(touch_all_softlockup_watchdogs);
90 91
92int proc_dosoftlockup_thresh(struct ctl_table *table, int write,
93 struct file *filp, void __user *buffer,
94 size_t *lenp, loff_t *ppos)
95{
96 touch_all_softlockup_watchdogs();
97 return proc_dointvec_minmax(table, write, filp, buffer, lenp, ppos);
98}
99
91/* 100/*
92 * This callback runs from the timer interrupt, and checks 101 * This callback runs from the timer interrupt, and checks
93 * whether the watchdog thread has hung or not: 102 * whether the watchdog thread has hung or not:
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 368d1638ee78..790f9d785663 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -809,7 +809,7 @@ static struct ctl_table kern_table[] = {
809 .data = &softlockup_thresh, 809 .data = &softlockup_thresh,
810 .maxlen = sizeof(int), 810 .maxlen = sizeof(int),
811 .mode = 0644, 811 .mode = 0644,
812 .proc_handler = &proc_dointvec_minmax, 812 .proc_handler = &proc_dosoftlockup_thresh,
813 .strategy = &sysctl_intvec, 813 .strategy = &sysctl_intvec,
814 .extra1 = &neg_one, 814 .extra1 = &neg_one,
815 .extra2 = &sixty, 815 .extra2 = &sixty,
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index d30561dda907..29044f500269 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -642,19 +642,6 @@ config RCU_TORTURE_TEST_RUNNABLE
642 642
643config RCU_CPU_STALL_DETECTOR 643config RCU_CPU_STALL_DETECTOR
644 bool "Check for stalled CPUs delaying RCU grace periods" 644 bool "Check for stalled CPUs delaying RCU grace periods"
645 depends on CLASSIC_RCU
646 default n
647 help
648 This option causes RCU to printk information on which
649 CPUs are delaying the current grace period, but only when
650 the grace period extends for excessive time periods.
651
652 Say Y if you want RCU to perform such checks.
653
654 Say N if you are unsure.
655
656config RCU_CPU_STALL_DETECTOR
657 bool "Check for stalled CPUs delaying RCU grace periods"
658 depends on CLASSIC_RCU || TREE_RCU 645 depends on CLASSIC_RCU || TREE_RCU
659 default n 646 default n
660 help 647 help