Patches contributed by Eötvös Lorand University


commit 60d970c254b95ec7a0fc4c590b510253987b64a0
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Aug 13 23:37:26 2009 +0200

    tracing: Fix syscall tracing on !HAVE_FTRACE_SYSCALLS architectures
    
    The new syscall_regfunc()/unregfunc() functions rely on
    the existence of TIF_SYSCALL_FTRACE - but that TIF flag
    is only offered by HAVE_FTRACE_SYSCALLS.
    
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Jason Baron <jbaron@redhat.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index 070a42bb8920..35dd27adb82c 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -579,6 +579,8 @@ __initcall(init_tracepoints);
 
 #endif /* CONFIG_MODULES */
 
+#ifdef CONFIG_FTRACE_SYSCALLS
+
 static DEFINE_MUTEX(regfunc_mutex);
 static int sys_tracepoint_refcount;
 
@@ -615,3 +617,4 @@ void syscall_unregfunc(void)
 	}
 	mutex_unlock(&regfunc_mutex);
 }
+#endif

commit 28402971d869e26271b25301011f667d3a5640c3
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Aug 13 10:13:22 2009 +0200

    perf_counter: Provide hw_perf_counter_setup_online() APIs
    
    Provide weak aliases for hw_perf_counter_setup_online(). This is
    used by the BTS patches (for v2.6.32), but it interacts with
    fixes so propagate this upstream. (it has no effect as of yet)
    
    Also export perf_counter_output() to architecture code.
    
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index a9d823a93fe8..2b36afe6ae0f 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -694,6 +694,8 @@ struct perf_sample_data {
 
 extern int perf_counter_overflow(struct perf_counter *counter, int nmi,
 				 struct perf_sample_data *data);
+extern void perf_counter_output(struct perf_counter *counter, int nmi,
+				struct perf_sample_data *data);
 
 /*
  * Return 1 for a software counter, 0 for a hardware counter
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index b0b20a07f394..e26d2fcfa320 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -88,6 +88,7 @@ void __weak hw_perf_disable(void)		{ barrier(); }
 void __weak hw_perf_enable(void)		{ barrier(); }
 
 void __weak hw_perf_counter_setup(int cpu)	{ barrier(); }
+void __weak hw_perf_counter_setup_online(int cpu)	{ barrier(); }
 
 int __weak
 hw_perf_group_sched_in(struct perf_counter *group_leader,
@@ -2630,7 +2631,7 @@ static u32 perf_counter_tid(struct perf_counter *counter, struct task_struct *p)
 	return task_pid_nr_ns(p, counter->ns);
 }
 
-static void perf_counter_output(struct perf_counter *counter, int nmi,
+void perf_counter_output(struct perf_counter *counter, int nmi,
 				struct perf_sample_data *data)
 {
 	int ret;
@@ -4592,6 +4593,11 @@ perf_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
 		perf_counter_init_cpu(cpu);
 		break;
 
+	case CPU_ONLINE:
+	case CPU_ONLINE_FROZEN:
+		hw_perf_counter_setup_online(cpu);
+		break;
+
 	case CPU_DOWN_PREPARE:
 	case CPU_DOWN_PREPARE_FROZEN:
 		perf_counter_exit_cpu(cpu);
@@ -4616,6 +4622,8 @@ void __init perf_counter_init(void)
 {
 	perf_cpu_notify(&perf_cpu_nb, (unsigned long)CPU_UP_PREPARE,
 			(void *)(long)smp_processor_id());
+	perf_cpu_notify(&perf_cpu_nb, (unsigned long)CPU_ONLINE,
+			(void *)(long)smp_processor_id());
 	register_cpu_notifier(&perf_cpu_nb);
 }
 

commit 04da8a43da804723a550f00dd158fd5b5e25ae35
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Aug 11 10:40:08 2009 +0200

    perf_counter, x86: Fix/improve apic fallback
    
    Johannes Stezenbach reported that his Pentium-M based
    laptop does not have the local APIC enabled by default,
    and hence perfcounters do not get initialized.
    
    Add a fallback for this case: allow non-sampled counters
    and return with an error on sampled counters. This allows
    'perf stat' to work out of box - and allows 'perf top'
    and 'perf record' to fall back on a hrtimer based sampling
    method.
    
    ( Passing 'lapic' on the boot line will allow hardware
      sampling to occur - but if the APIC is disabled
      permanently by the hardware then this fallback still
      allows more systems to use perfcounters. )
    
    Also decouple perfcounter support from X86_LOCAL_APIC.
    
    -v2: fix typo breaking counters on all other systems ...
    
    Reported-by: Johannes Stezenbach <js@sig21.net>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 738bdc6b0f8b..13ffa5df37d7 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -24,6 +24,7 @@ config X86
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select HAVE_IDE
 	select HAVE_OPROFILE
+	select HAVE_PERF_COUNTERS if (!M386 && !M486)
 	select HAVE_IOREMAP_PROT
 	select HAVE_KPROBES
 	select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -742,7 +743,6 @@ config X86_UP_IOAPIC
 config X86_LOCAL_APIC
 	def_bool y
 	depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC
-	select HAVE_PERF_COUNTERS if (!M386 && !M486)
 
 config X86_IO_APIC
 	def_bool y
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index fffc126dbdf0..900332b800f8 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -55,6 +55,7 @@ struct x86_pmu {
 	int		num_counters_fixed;
 	int		counter_bits;
 	u64		counter_mask;
+	int		apic;
 	u64		max_period;
 	u64		intel_ctrl;
 };
@@ -613,6 +614,7 @@ static DEFINE_MUTEX(pmc_reserve_mutex);
 
 static bool reserve_pmc_hardware(void)
 {
+#ifdef CONFIG_X86_LOCAL_APIC
 	int i;
 
 	if (nmi_watchdog == NMI_LOCAL_APIC)
@@ -627,9 +629,11 @@ static bool reserve_pmc_hardware(void)
 		if (!reserve_evntsel_nmi(x86_pmu.eventsel + i))
 			goto eventsel_fail;
 	}
+#endif
 
 	return true;
 
+#ifdef CONFIG_X86_LOCAL_APIC
 eventsel_fail:
 	for (i--; i >= 0; i--)
 		release_evntsel_nmi(x86_pmu.eventsel + i);
@@ -644,10 +648,12 @@ static bool reserve_pmc_hardware(void)
 		enable_lapic_nmi_watchdog();
 
 	return false;
+#endif
 }
 
 static void release_pmc_hardware(void)
 {
+#ifdef CONFIG_X86_LOCAL_APIC
 	int i;
 
 	for (i = 0; i < x86_pmu.num_counters; i++) {
@@ -657,6 +663,7 @@ static void release_pmc_hardware(void)
 
 	if (nmi_watchdog == NMI_LOCAL_APIC)
 		enable_lapic_nmi_watchdog();
+#endif
 }
 
 static void hw_perf_counter_destroy(struct perf_counter *counter)
@@ -748,6 +755,15 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
 		hwc->sample_period = x86_pmu.max_period;
 		hwc->last_period = hwc->sample_period;
 		atomic64_set(&hwc->period_left, hwc->sample_period);
+	} else {
+		/*
+		 * If we have a PMU initialized but no APIC
+		 * interrupts, we cannot sample hardware
+		 * counters (user-space has to fall back and
+		 * sample via a hrtimer based software counter):
+		 */
+		if (!x86_pmu.apic)
+			return -EOPNOTSUPP;
 	}
 
 	counter->destroy = hw_perf_counter_destroy;
@@ -1449,18 +1465,22 @@ void smp_perf_pending_interrupt(struct pt_regs *regs)
 
 void set_perf_counter_pending(void)
 {
+#ifdef CONFIG_X86_LOCAL_APIC
 	apic->send_IPI_self(LOCAL_PENDING_VECTOR);
+#endif
 }
 
 void perf_counters_lapic_init(void)
 {
-	if (!x86_pmu_initialized())
+#ifdef CONFIG_X86_LOCAL_APIC
+	if (!x86_pmu.apic || !x86_pmu_initialized())
 		return;
 
 	/*
 	 * Always use NMI for PMU
 	 */
 	apic_write(APIC_LVTPC, APIC_DM_NMI);
+#endif
 }
 
 static int __kprobes
@@ -1484,7 +1504,9 @@ perf_counter_nmi_handler(struct notifier_block *self,
 
 	regs = args->regs;
 
+#ifdef CONFIG_X86_LOCAL_APIC
 	apic_write(APIC_LVTPC, APIC_DM_NMI);
+#endif
 	/*
 	 * Can't rely on the handled return value to say it was our NMI, two
 	 * counters could trigger 'simultaneously' raising two back-to-back NMIs.
@@ -1515,6 +1537,7 @@ static struct x86_pmu p6_pmu = {
 	.event_map		= p6_pmu_event_map,
 	.raw_event		= p6_pmu_raw_event,
 	.max_events		= ARRAY_SIZE(p6_perfmon_event_map),
+	.apic			= 1,
 	.max_period		= (1ULL << 31) - 1,
 	.version		= 0,
 	.num_counters		= 2,
@@ -1541,6 +1564,7 @@ static struct x86_pmu intel_pmu = {
 	.event_map		= intel_pmu_event_map,
 	.raw_event		= intel_pmu_raw_event,
 	.max_events		= ARRAY_SIZE(intel_perfmon_event_map),
+	.apic			= 1,
 	/*
 	 * Intel PMCs cannot be accessed sanely above 32 bit width,
 	 * so we install an artificial 1<<31 period regardless of
@@ -1564,6 +1588,7 @@ static struct x86_pmu amd_pmu = {
 	.num_counters		= 4,
 	.counter_bits		= 48,
 	.counter_mask		= (1ULL << 48) - 1,
+	.apic			= 1,
 	/* use highest bit to detect overflow */
 	.max_period		= (1ULL << 47) - 1,
 };
@@ -1589,13 +1614,14 @@ static int p6_pmu_init(void)
 		return -ENODEV;
 	}
 
+	x86_pmu = p6_pmu;
+
 	if (!cpu_has_apic) {
 		pr_info("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n");
-		return -ENODEV;
+		pr_info("no hardware sampling interrupt available.\n");
+		x86_pmu.apic = 0;
 	}
 
-	x86_pmu				= p6_pmu;
-
 	return 0;
 }
 

commit 89034bc2c7b839702c00a704e79d112737f98be0
Merge: fb82ad719831 85dfd81dc57e
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Aug 11 14:19:09 2009 +0200

    Merge branch 'linus' into tracing/core
    
    Conflicts:
            kernel/trace/trace_events_filter.c
    
    We use the tracing/core version.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --cc include/linux/ftrace_event.h
index 26d3673d5143,a81170de7f6b..ac8c6f8cf242
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@@ -118,14 -118,12 +120,12 @@@ struct ftrace_event_call 
  	int			(*define_fields)(void);
  	struct list_head	fields;
  	int			filter_active;
 -	void			*filter;
 +	struct event_filter	*filter;
  	void			*mod;
  
- #ifdef CONFIG_EVENT_PROFILE
- 	atomic_t	profile_count;
- 	int		(*profile_enable)(struct ftrace_event_call *);
- 	void		(*profile_disable)(struct ftrace_event_call *);
- #endif
+ 	atomic_t		profile_count;
+ 	int			(*profile_enable)(struct ftrace_event_call *);
+ 	void			(*profile_disable)(struct ftrace_event_call *);
  };
  
  #define MAX_FILTER_PRED		32

commit f64ccccb8afa43abdd63fcbd230f818d6ea0883f
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Aug 11 10:26:33 2009 +0200

    perf_counter, x86: Fix generic cache events on P6-mobile CPUs
    
    Johannes Stezenbach reported that 'perf stat' does not count
    cache-miss and cache-references events on his Pentium-M based
    laptop.
    
    This is because we left them blank in p6_perfmon_event_map[],
    fill them in.
    
    Reported-by: Johannes Stezenbach <js@sig21.net>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 40e233a24d9f..fffc126dbdf0 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -72,8 +72,8 @@ static const u64 p6_perfmon_event_map[] =
 {
   [PERF_COUNT_HW_CPU_CYCLES]		= 0x0079,
   [PERF_COUNT_HW_INSTRUCTIONS]		= 0x00c0,
-  [PERF_COUNT_HW_CACHE_REFERENCES]	= 0x0000,
-  [PERF_COUNT_HW_CACHE_MISSES]		= 0x0000,
+  [PERF_COUNT_HW_CACHE_REFERENCES]	= 0x0f2e,
+  [PERF_COUNT_HW_CACHE_MISSES]		= 0x012e,
   [PERF_COUNT_HW_BRANCH_INSTRUCTIONS]	= 0x00c4,
   [PERF_COUNT_HW_BRANCH_MISSES]		= 0x00c5,
   [PERF_COUNT_HW_BUS_CYCLES]		= 0x0062,

commit 3c581a7f94542341bf0da496a226b44ac63521a8
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Aug 11 10:47:36 2009 +0200

    perf_counter, x86: Fix lapic printk message
    
    Instead of this garbled bootup on UP Pentium-M systems:
    
    [    0.015048] Performance Counters:
    [    0.016004] no Local APIC, try rebooting with lapicno PMU driver, software counters only.
    
    Print:
    
    [    0.015050] Performance Counters:
    [    0.016004] no APIC, boot with the "lapic" boot parameter to force-enable it.
    [    0.017003] no PMU driver, software counters only.
    
    Cf: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index a7aa8f900954..40e233a24d9f 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -1590,7 +1590,7 @@ static int p6_pmu_init(void)
 	}
 
 	if (!cpu_has_apic) {
-		pr_info("no Local APIC, try rebooting with lapic");
+		pr_info("no APIC, boot with the \"lapic\" boot parameter to force-enable it.\n");
 		return -ENODEV;
 	}
 

commit e3560336be655c6791316482fe288b119f34c427
Merge: 26528e773ecc 7b2aa037e878
Author: Ingo Molnar <mingo@elte.hu>
Date:   Sun Aug 9 12:46:45 2009 +0200

    Merge branch 'linus' into tracing/urgent
    
    Merge reason: Merge up to almost-rc6 to pick up latest perfcounters
                  (on which we'll queue up a dependent fix)
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

commit 72c4d8530244264317a662de9a55cc47e6c8e9df
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Aug 3 08:47:07 2009 +0200

    x86: Introduce GDT_ENTRY_INIT(), fix APM
    
    This crash:
    
    [    0.891983] calling  cache_sysfs_init+0x0/0x1ee @ 1
    [    0.897251] initcall cache_sysfs_init+0x0/0x1ee returned 0 after 405 usecs
    [    0.904019] calling  mce_init_device+0x0/0x242 @ 1
    [    0.909124] initcall mce_init_device+0x0/0x242 returned 0 after 347 usecs
    [    0.915815] calling  apm_init+0x0/0x38d @ 1
    [    0.919967] apm: BIOS version 1.2 Flags 0x07 (Driver version 1.16ac)
    [    0.926813] general protection fault: 0000 [#1]
    [    0.927269] last sysfs file:
    [    0.927269] Modules linked in:
    [    0.927269]
    [    0.927269] Pid: 271, comm: kapmd Not tainted (2.6.31-rc3-00100-gd520da1-dirty #311) System Product Name
    [    0.927269] EIP: 00c0:[<000082b2>] EFLAGS: 00010002 CPU: 0
    [    0.927269] EIP is at 0x82b2
    [    0.927269] EAX: 0000530e EBX: 00000000 ECX: 00000102 EDX: 00000000
    [    0.927269] ESI: 00000000 EDI: f6a4bf44 EBP: 67890000 ESP: f6a4beec
    [    0.927269]  DS: 00c8 ES: 0000 FS: 0000 GS: 0000 SS: 0068
    [    0.927269] Process kapmd (pid: 271, ti=f6a4a000 task=f7142280 task.ti=f6a4a000)
    [    0.927269] Stack:
    [    0.927269]  0000828d 02160000 00b88092 f6a4bf3c c102a63d 00000060 f6a4bf3c f6a4bf44
    [    0.927269] <0> 0000007b 0000007b 00000000 00000000 00000000 00000000 560aae9e 00000000
    [    0.927269] <0> 00000200 f705fd74 00000000 c102af70 f6a4bf60 c102a6ec 0000530e 00000000
    [    0.927269] Call Trace:
    [    0.927269]  [<c102a63d>] ? __apm_bios_call_simple+0x7d/0x110
    [    0.927269]  [<c102af70>] ? apm+0x0/0x6a0
    [    0.927269]  [<c102a6ec>] ? apm_bios_call_simple+0x1c/0x50
    [    0.927269]  [<c102b3f5>] ? apm+0x485/0x6a0
    [    0.927269]  [<c1038e7a>] ? finish_task_switch+0x2a/0xb0
    [    0.927269]  [<c164a69e>] ? schedule+0x31e/0x480
    [    0.927269]  [<c102af70>] ? apm+0x0/0x6a0
    [    0.927269]  [<c102af70>] ? apm+0x0/0x6a0
    [    0.927269]  [<c1052654>] ? kthread+0x74/0x80
    [    0.927269]  [<c10525e0>] ? kthread+0x0/0x80
    [    0.927269]  [<c101d627>] ? kernel_thread_helper+0x7/0x10
    [    0.927269] Code:  Bad EIP value.
    [    0.927269] EIP: [<000082b2>] 0x82b2 SS:ESP 0068:f6a4beec
    [    0.927269] ---[ end trace a7919e7f17c0a725 ]---
    [    0.927269] Kernel panic - not syncing: Fatal exception
    [    0.927269] Pid: 271, comm: kapmd Tainted: G      D    2.6.31-rc3-00100-gd520da1-dirty #311
    
    Is caused by an incorrect GDT_ENTRY_INIT() conversion in the apm
    code, as noticed by hpa.
    
    Reported-by: Ingo Molnar <mingo@elte.hu>
    Noticed-by: "H. Peter Anvin" <hpa@zytor.com>
    Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
    LKML-Reference: <20090808094905.GA2954@localhost.localdomain>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 8c9bc287f8fb..b5764a269645 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -106,7 +106,7 @@ DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
 	/* 16-bit code */
 	[GDT_ENTRY_APMBIOS_BASE+1]	= GDT_ENTRY_INIT(0x009a, 0, 0xffff),
 	/* data */
-	[GDT_ENTRY_APMBIOS_BASE+2]	= GDT_ENTRY_INIT(0x409a, 0, 0xffff),
+	[GDT_ENTRY_APMBIOS_BASE+2]	= GDT_ENTRY_INIT(0x4092, 0, 0xffff),
 
 	[GDT_ENTRY_ESPFIX_SS]		= GDT_ENTRY_INIT(0xc092, 0, 0xfffff),
 	[GDT_ENTRY_PERCPU]		= GDT_ENTRY_INIT(0xc092, 0, 0xfffff),

commit 0bf52b981770cbf006323bab5177f2858a196766
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Aug 4 21:16:58 2009 +0000

    net: Fix spinlock use in alloc_netdev_mq()
    
    -tip testing found this lockdep warning:
    
    [    2.272010] calling  net_dev_init+0x0/0x164 @ 1
    [    2.276033] device class 'net': registering
    [    2.280191] INFO: trying to register non-static key.
    [    2.284005] the code is fine but needs lockdep annotation.
    [    2.284005] turning off the locking correctness validator.
    [    2.284005] Pid: 1, comm: swapper Not tainted 2.6.31-rc5-tip #1145
    [    2.284005] Call Trace:
    [    2.284005]  [<7958eb4e>] ? printk+0xf/0x11
    [    2.284005]  [<7904f83c>] __lock_acquire+0x11b/0x622
    [    2.284005]  [<7908c9b7>] ? alloc_debug_processing+0xf9/0x144
    [    2.284005]  [<7904e2be>] ? mark_held_locks+0x3a/0x52
    [    2.284005]  [<7908dbc4>] ? kmem_cache_alloc+0xa8/0x13f
    [    2.284005]  [<7904e475>] ? trace_hardirqs_on_caller+0xa2/0xc3
    [    2.284005]  [<7904fdf6>] lock_acquire+0xb3/0xd0
    [    2.284005]  [<79489678>] ? alloc_netdev_mq+0xf5/0x1ad
    [    2.284005]  [<79591514>] _spin_lock_bh+0x2d/0x5d
    [    2.284005]  [<79489678>] ? alloc_netdev_mq+0xf5/0x1ad
    [    2.284005]  [<79489678>] alloc_netdev_mq+0xf5/0x1ad
    [    2.284005]  [<793a38f2>] ? loopback_setup+0x0/0x74
    [    2.284005]  [<798eecd0>] loopback_net_init+0x20/0x5d
    [    2.284005]  [<79483efb>] register_pernet_device+0x23/0x4b
    [    2.284005]  [<798f5c9f>] net_dev_init+0x115/0x164
    [    2.284005]  [<7900104f>] do_one_initcall+0x4a/0x11a
    [    2.284005]  [<798f5b8a>] ? net_dev_init+0x0/0x164
    [    2.284005]  [<79066f6d>] ? register_irq_proc+0x8c/0xa8
    [    2.284005]  [<798cc29a>] do_basic_setup+0x42/0x52
    [    2.284005]  [<798cc30a>] kernel_init+0x60/0xa1
    [    2.284005]  [<798cc2aa>] ? kernel_init+0x0/0xa1
    [    2.284005]  [<79003e03>] kernel_thread_helper+0x7/0x10
    [    2.284078] device: 'lo': device_add
    [    2.288248] initcall net_dev_init+0x0/0x164 returned 0 after 11718 usecs
    [    2.292010] calling  neigh_init+0x0/0x66 @ 1
    [    2.296010] initcall neigh_init+0x0/0x66 returned 0 after 0 usecs
    
    it's using an zero-initialized spinlock. This is a side-effect of:
    
            dev_unicast_init(dev);
    
    in alloc_netdev_mq() making use of dev->addr_list_lock.
    
    The device has just been allocated freshly, it's not accessible
    anywhere yet so no locking is needed at all - in fact it's wrong
    to lock it here (the lock isnt initialized yet).
    
    This bug was introduced via:
    
    | commit a6ac65db2329e7685299666f5f7b6093c7b0f3a0
    | Date:   Thu Jul 30 01:06:12 2009 +0000
    |
    |     net: restore the original spinlock to protect unicast list
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    Acked-by: Jiri Pirko <jpirko@redhat.com>
    Tested-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/net/core/dev.c b/net/core/dev.c
index 43e61ba7bd95..6a94475aee85 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4007,9 +4007,7 @@ static void dev_unicast_flush(struct net_device *dev)
 
 static void dev_unicast_init(struct net_device *dev)
 {
-	netif_addr_lock_bh(dev);
 	__hw_addr_init(&dev->uc);
-	netif_addr_unlock_bh(dev);
 }
 
 

commit f26542600e605482a1231c44ddb2966d69bd09b0
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Jun 29 10:40:20 2009 +0200

    perf_counter: Set the CONFIG_PERF_COUNTERS default to y if CONFIG_PROFILING=y
    
    If user has already enabled profiling support in the kernel
    (for oprofile, old-style profiling of ftrace) then offer up
    perfcounters with a y default in interactive kconfig sessions.
    
    Still keep it off by default otherwise.
    
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/init/Kconfig b/init/Kconfig
index 823ee0a2d2a3..3f7e60995c80 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -940,6 +940,7 @@ menu "Performance Counters"
 
 config PERF_COUNTERS
 	bool "Kernel Performance Counters"
+	default y if PROFILING
 	depends on HAVE_PERF_COUNTERS
 	select ANON_INODES
 	help