public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Wrong cpumask_of_node usage in kernel/smp.c
@ 2010-01-13  0:14 Pallipadi, Venkatesh
  2010-01-13  9:22 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Pallipadi, Venkatesh @ 2010-01-13  0:14 UTC (permalink / raw)
  To: Rusty Russell, Andrew Morton, Thomas Gleixner; +Cc: linux-kernel


I am getting dump_stack from cpumask_of_node() with recent kernels.
Dump stack msg that repeats few times
[    6.504569] cpumask_of_node(2): node > nr_node_ids(1)
[    6.504692] Pid: 1, comm: swapper Not tainted 2.6.33-rc3-00294-g99ad0b4 #1223
[    6.504819] Call Trace:
[    6.504937]  [<ffffffff81026628>] cpumask_of_node+0x28/0x5c
[    6.505063]  [<ffffffff81071ad8>] smp_call_function_any+0x6a/0xff
[    6.505193]  [<ffffffff81016c15>] ? do_drv_read+0x0/0x34
[    6.505315]  [<ffffffff81016af9>] get_cur_val+0xb5/0x107
[    6.505437]  [<ffffffff81016bc4>] get_cur_freq_on_cpu+0x79/0xca
[    6.505561]  [<ffffffff8101747b>] acpi_cpufreq_cpu_init+0x463/0x561
[    6.505689]  [<ffffffff814f8353>] cpufreq_add_dev+0x317/0x66d
[    6.505813]  [<ffffffff8136fbaa>] sysdev_driver_register+0xcb/0x125
[    6.505938]  [<ffffffff814f6a7c>] cpufreq_register_driver+0xcc/0x1ea
[    6.506065]  [<ffffffff81c42962>] ? acpi_cpufreq_init+0x0/0x128
[    6.506193]  [<ffffffff81c42a78>] acpi_cpufreq_init+0x116/0x128
[    6.506318]  [<ffffffff81c42962>] ? acpi_cpufreq_init+0x0/0x128
[    6.506443]  [<ffffffff810001fa>] do_one_initcall+0x5f/0x154
[    6.506569]  [<ffffffff81c3a6a3>] kernel_init+0x198/0x1ed
[    6.506690]  [<ffffffff81003014>] kernel_thread_helper+0x4/0x10
[    6.506816]  [<ffffffff815f41fc>] ? restore_args+0x0/0x30
[    6.506938]  [<ffffffff81c3a50b>] ? kernel_init+0x0/0x1ed
[    6.507060]  [<ffffffff81003010>] ? kernel_thread_helper+0x0/0x10

Looks like a bug from changeset
commit 2ea6dec4a22a6f66f6633876212fd4d195cf8277
Author: Rusty Russell <rusty@rustcorp.com.au>
Date:   Tue Nov 17 14:27:27 2009 -0800

    generic-ipi: Add smp_call_function_any()
    
    Andrew points out that acpi-cpufreq uses cpumask_any, when it really
    would prefer to use the same CPU if possible (to avoid an IPI).  In
    general, this seems a good idea to offer.
    

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
---
 kernel/smp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index de735a6..f104084 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -347,7 +347,7 @@ int smp_call_function_any(const struct cpumask *mask,
 		goto call;
 
 	/* Try for same node. */
-	nodemask = cpumask_of_node(cpu);
+	nodemask = cpumask_of_node(cpu_to_node(cpu));
 	for (cpu = cpumask_first_and(nodemask, mask); cpu < nr_cpu_ids;
 	     cpu = cpumask_next_and(cpu, nodemask, mask)) {
 		if (cpu_online(cpu))
-- 
1.6.0.6


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

* Re: [PATCH] Wrong cpumask_of_node usage in kernel/smp.c
  2010-01-13  0:14 [PATCH] Wrong cpumask_of_node usage in kernel/smp.c Pallipadi, Venkatesh
@ 2010-01-13  9:22 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2010-01-13  9:22 UTC (permalink / raw)
  To: Pallipadi, Venkatesh; +Cc: Andrew Morton, Thomas Gleixner, linux-kernel

On Wed, 13 Jan 2010 10:44:01 am Pallipadi, Venkatesh wrote:
> 
> I am getting dump_stack from cpumask_of_node() with recent kernels.
> Dump stack msg that repeats few times
> [    6.504569] cpumask_of_node(2): node > nr_node_ids(1)

Thanks, this fix is already queued.

Cheers,
Rusty.

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

end of thread, other threads:[~2010-01-13  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-13  0:14 [PATCH] Wrong cpumask_of_node usage in kernel/smp.c Pallipadi, Venkatesh
2010-01-13  9:22 ` Rusty Russell

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