mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86, cpu hotplug, Fix stack frame warning in check_irq_vectors_for_cpu_disable()
@ 2014-01-28 13:22 Prarit Bhargava
  2014-01-30 23:05 ` David Rientjes
  2014-01-31  0:42 ` [tip:x86/urgent] x86, cpu hotplug: " tip-bot for Prarit Bhargava
  0 siblings, 2 replies; 3+ messages in thread
From: Prarit Bhargava @ 2014-01-28 13:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Prarit Bhargava, Andi Kleen, Michel Lespinasse, Seiji Aguchi,
	Yang Zhang, Paul Gortmaker, Janet Morgan, Tony Luck, Ruiv Wang,
	Gong Chen, H. Peter Anvin, x86, Fengguang Wu, yinghai, tglx,
	mingo, hpa

Further discussion here: http://marc.info/?l=linux-kernel&m=139073901101034&w=2

kbuild, 0day kernel build service, outputs the warning:

arch/x86/kernel/irq.c:333:1: warning: the frame size of 2056 bytes
is larger than 2048 bytes [-Wframe-larger-than=]

because check_irq_vectors_for_cpu_disable() allocates two cpumasks on the
stack.   Fix this by moving the two cpumasks to a global file context.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: Yang Zhang <yang.z.zhang@Intel.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Janet Morgan <janet.morgan@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Ruiv Wang <ruiv.wang@gmail.com>
Cc: Gong Chen <gong.chen@linux.intel.com>
Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: Gong Chen <gong.chen@linux.intel.com>
Cc: x86@kernel.org
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: yinghai@kernel.org
Cc: tglx@linutronix.de
Cc: mingo@elte.hu
Cc: hpa@zytor.com
---
 arch/x86/kernel/irq.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 4207e8d..3910078 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -262,6 +262,14 @@ __visible void smp_trace_x86_platform_ipi(struct pt_regs *regs)
 EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq);
 
 #ifdef CONFIG_HOTPLUG_CPU
+
+/* These two declarations are only used in check_irq_vectors_for_cpu_disable()
+ * below, which is protected by stop_machine().  Putting them on the stack
+ * results in a stack frame overflow.  Dynamically allocating could result in a
+ * failure so declare these two cpumasks as global.
+ */
+static struct cpumask affinity_new, online_new;
+
 /*
  * This cpu is going to be removed and its vectors migrated to the remaining
  * online cpus.  Check to see if there are enough vectors in the remaining cpus.
@@ -273,7 +281,6 @@ int check_irq_vectors_for_cpu_disable(void)
 	unsigned int this_cpu, vector, this_count, count;
 	struct irq_desc *desc;
 	struct irq_data *data;
-	struct cpumask affinity_new, online_new;
 
 	this_cpu = smp_processor_id();
 	cpumask_copy(&online_new, cpu_online_mask);
-- 
1.7.9.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-31  0:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-28 13:22 [PATCH] x86, cpu hotplug, Fix stack frame warning in check_irq_vectors_for_cpu_disable() Prarit Bhargava
2014-01-30 23:05 ` David Rientjes
2014-01-31  0:42 ` [tip:x86/urgent] x86, cpu hotplug: " tip-bot for Prarit Bhargava

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome