Patches contributed by Eötvös Lorand University
commit c71dd42db2c6f1637b92502a214587431c1a6ad2
Author: Ingo Molnar <mingo@elte.hu>
Date: Fri Dec 19 01:09:51 2008 +0100
tracing: fix warnings in kernel/trace/trace_sched_switch.c
these warnings:
kernel/trace/trace_sched_switch.c: In function ‘tracing_sched_register’:
kernel/trace/trace_sched_switch.c:96: warning: passing argument 1 of ‘register_trace_sched_wakeup_new’ from incompatible pointer type
kernel/trace/trace_sched_switch.c:112: warning: passing argument 1 of ‘unregister_trace_sched_wakeup_new’ from incompatible pointer type
kernel/trace/trace_sched_switch.c: In function ‘tracing_sched_unregister’:
kernel/trace/trace_sched_switch.c:121: warning: passing argument 1 of ‘unregister_trace_sched_wakeup_new’ from incompatible pointer type
Trigger because sched_wakeup_new tracepoints need the same trace
signature as sched_wakeup - which was changed recently.
Fix it.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/include/trace/sched.h b/include/trace/sched.h
index f4549d506b16..bc4c9eadc6ba 100644
--- a/include/trace/sched.h
+++ b/include/trace/sched.h
@@ -21,8 +21,8 @@ DECLARE_TRACE(sched_wakeup,
TPARGS(rq, p));
DECLARE_TRACE(sched_wakeup_new,
- TPPROTO(struct rq *rq, struct task_struct *p),
- TPARGS(rq, p));
+ TPPROTO(struct rq *rq, struct task_struct *p, int success),
+ TPARGS(rq, p, success));
DECLARE_TRACE(sched_switch,
TPPROTO(struct rq *rq, struct task_struct *prev,
diff --git a/kernel/sched.c b/kernel/sched.c
index d377097572f9..ac5a70a87d1e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2457,7 +2457,7 @@ void wake_up_new_task(struct task_struct *p, unsigned long clone_flags)
p->sched_class->task_new(rq, p);
inc_nr_running(rq);
}
- trace_sched_wakeup_new(rq, p);
+ trace_sched_wakeup_new(rq, p, 1);
check_preempt_curr(rq, p, 0);
#ifdef CONFIG_SMP
if (p->sched_class->task_wake_up)
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c
index 863390557b44..781d72ef873c 100644
--- a/kernel/trace/trace_sched_switch.c
+++ b/kernel/trace/trace_sched_switch.c
@@ -247,3 +247,4 @@ __init static int init_sched_switch_trace(void)
return register_tracer(&sched_switch_trace);
}
device_initcall(init_sched_switch_trace);
+
commit 3bddb9a3246f6df5cf3b7655cb541ac10203bb71
Author: Ingo Molnar <mingo@elte.hu>
Date: Fri Dec 19 01:03:29 2008 +0100
tracing: fix warning in kernel/trace/trace.c
this warning:
kernel/trace/trace.c: In function ‘print_lat_fmt’:
kernel/trace/trace.c:1826: warning: unused variable ‘state’
Triggers because 'state' has become unused - remove it.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 1a3d6b329782..49fc7201295e 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1816,7 +1816,6 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu)
char *comm;
int S, T;
int i;
- unsigned state;
if (entry->type == TRACE_CONT)
return TRACE_TYPE_HANDLED;
commit b2e3c0adec918ea22b6c9d7c76193dd3aaba9bd4
Author: Ingo Molnar <mingo@elte.hu>
Date: Fri Dec 19 00:48:27 2008 +0100
hrtimers: fix warning in kernel/hrtimer.c
this warning:
kernel/hrtimer.c: In function ‘hrtimer_cpu_notify’:
kernel/hrtimer.c:1574: warning: unused variable ‘dcpu’
is caused because 'dcpu' is only used in the CONFIG_HOTPLUG_CPU case.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index b741f850426e..bda9cb924276 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1571,7 +1571,7 @@ static void tickle_timers(void *arg)
static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
- int dcpu, scpu = (long)hcpu;
+ int scpu = (long)hcpu;
switch (action) {
@@ -1583,10 +1583,14 @@ static int __cpuinit hrtimer_cpu_notify(struct notifier_block *self,
#ifdef CONFIG_HOTPLUG_CPU
case CPU_DEAD:
case CPU_DEAD_FROZEN:
+ {
+ int dcpu;
+
clockevents_notify(CLOCK_EVT_NOTIFY_CPU_DEAD, &scpu);
dcpu = migrate_hrtimers(scpu);
smp_call_function_single(dcpu, tickle_timers, NULL, 0);
break;
+ }
#endif
default:
commit d110ec3a1e1f522e2e9dfceb9c36d6590c26d2d4
Merge: 343e9099c815 55dac3a5553b
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 18 21:54:49 2008 +0100
Merge branch 'linus' into core/rcu
commit c9bc03ac312c6b65a32a183424f1f1383d94f5cf
Merge: 55aab5f49e38 84df81759590
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 18 13:28:11 2008 +0100
Merge branch 'iommu-fixes-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent
commit 40874491f9e9a4cb08eaf663dbe018bf5671975a
Merge: d680fe44775e d072c25f531c
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 18 12:51:05 2008 +0100
Merge branches 'tracing/ftrace' and 'tracing/hw-branch-tracing' into tracing/core
commit 9a3d8f735eee90bb5b1351983e946bc637041c01
Merge: b9974dc6bddd a98f8fd24fb2
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 18 11:55:06 2008 +0100
Merge branch 'x86/apic' into cpus4096
This done for conflict prevention: we merge it into the cpus4096 tree
because upcoming cpumask changes will touch apic.c that would collide
with x86/apic otherwise.
commit b9974dc6bddd41fbdc2583f196a34fbcebd8b089
Merge: d733e00d7c10 55dac3a5553b
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Dec 18 11:48:30 2008 +0100
Merge branch 'linus' into cpus4096
commit d733e00d7c10cc68333fbb88108bb15bb044f61b
Author: Ingo Molnar <mingo@elte.hu>
Date: Wed Dec 17 13:35:51 2008 +0100
x86: update io_apic.c to the new cpumask code
Impact: build fix
The sparseirq tree crossed with the cpumask changes, fix the fallout.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 6bd51ce3ce32..58938cc4b7d3 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -347,13 +347,14 @@ void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
}
}
-static void set_extra_move_desc(struct irq_desc *desc, cpumask_t mask)
+static void
+set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
{
struct irq_cfg *cfg = desc->chip_data;
if (!cfg->move_in_progress) {
/* it means that domain is not changed */
- if (!cpus_intersects(desc->affinity, mask))
+ if (!cpumask_intersects(&desc->affinity, mask))
cfg->move_desc_pending = 1;
}
}
commit 855caa37b9b61c1ccfeb91a2bc04d90bfc5e4525
Merge: 948a7b2b5e2b c415b3dce30d
Author: Ingo Molnar <mingo@elte.hu>
Date: Wed Dec 17 13:24:52 2008 +0100
Merge branch 'x86/crashdump' into cpus4096
Conflicts:
arch/x86/kernel/crash.c
Merged for semantic conflict:
arch/x86/kernel/reboot.c
diff --cc arch/x86/kernel/reboot.c
index 0e3dbc7b2bdb,c3cd512484e5..ba7b9a0e6063
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@@ -548,3 -517,95 +551,92 @@@ void machine_crash_shutdown(struct pt_r
machine_ops.crash_shutdown(regs);
}
#endif
+
+
+ #if defined(CONFIG_SMP)
+
+ /* This keeps a track of which one is crashing cpu. */
+ static int crashing_cpu;
+ static nmi_shootdown_cb shootdown_callback;
+
+ static atomic_t waiting_for_crash_ipi;
+
+ static int crash_nmi_callback(struct notifier_block *self,
+ unsigned long val, void *data)
+ {
+ int cpu;
+
+ if (val != DIE_NMI_IPI)
+ return NOTIFY_OK;
+
+ cpu = raw_smp_processor_id();
+
+ /* Don't do anything if this handler is invoked on crashing cpu.
+ * Otherwise, system will completely hang. Crashing cpu can get
+ * an NMI if system was initially booted with nmi_watchdog parameter.
+ */
+ if (cpu == crashing_cpu)
+ return NOTIFY_STOP;
+ local_irq_disable();
+
+ shootdown_callback(cpu, (struct die_args *)data);
+
+ atomic_dec(&waiting_for_crash_ipi);
+ /* Assume hlt works */
+ halt();
+ for (;;)
+ cpu_relax();
+
+ return 1;
+ }
+
+ static void smp_send_nmi_allbutself(void)
+ {
- cpumask_t mask = cpu_online_map;
- cpu_clear(safe_smp_processor_id(), mask);
- if (!cpus_empty(mask))
- send_IPI_mask(mask, NMI_VECTOR);
++ send_IPI_allbutself(NMI_VECTOR);
+ }
+
+ static struct notifier_block crash_nmi_nb = {
+ .notifier_call = crash_nmi_callback,
+ };
+
+ /* Halt all other CPUs, calling the specified function on each of them
+ *
+ * This function can be used to halt all other CPUs on crash
+ * or emergency reboot time. The function passed as parameter
+ * will be called inside a NMI handler on all CPUs.
+ */
+ void nmi_shootdown_cpus(nmi_shootdown_cb callback)
+ {
+ unsigned long msecs;
+ local_irq_disable();
+
+ /* Make a note of crashing cpu. Will be used in NMI callback.*/
+ crashing_cpu = safe_smp_processor_id();
+
+ shootdown_callback = callback;
+
+ atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
+ /* Would it be better to replace the trap vector here? */
+ if (register_die_notifier(&crash_nmi_nb))
+ return; /* return what? */
+ /* Ensure the new callback function is set before sending
+ * out the NMI
+ */
+ wmb();
+
+ smp_send_nmi_allbutself();
+
+ msecs = 1000; /* Wait at most a second for the other cpus to stop */
+ while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) {
+ mdelay(1);
+ msecs--;
+ }
+
+ /* Leave the nmi callback set */
+ }
+ #else /* !CONFIG_SMP */
+ void nmi_shootdown_cpus(nmi_shootdown_cb callback)
+ {
+ /* No other CPUs to shoot down */
+ }
+ #endif