public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
To: Rusty Russell <rusty@rustcorp.com.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Wrong cpumask_of_node usage in kernel/smp.c
Date: Tue, 12 Jan 2010 16:14:01 -0800	[thread overview]
Message-ID: <20100113001401.GA26192@linux-os.sc.intel.com> (raw)


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


             reply	other threads:[~2010-01-13  0:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13  0:14 Pallipadi, Venkatesh [this message]
2010-01-13  9:22 ` [PATCH] Wrong cpumask_of_node usage in kernel/smp.c Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100113001401.GA26192@linux-os.sc.intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox