From: Don Zickus <dzickus@redhat.com>
To: Ming Lei <ming.lei@canonical.com>
Cc: Sameer Nanda <snanda@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel/watchdog.c : fix smp_processor_id() warning
Date: Thu, 26 Jul 2012 15:43:24 -0400 [thread overview]
Message-ID: <20120726194324.GG5637@redhat.com> (raw)
In-Reply-To: <1343191185-7746-1-git-send-email-ming.lei@canonical.com>
On Wed, Jul 25, 2012 at 12:39:45PM +0800, Ming Lei wrote:
> Use raw_smp_processor_id in lockup_detector_bootcpu_resume()
> because it is enough when non-boot CPUs are offline.
>
> This patch fixes the following warning when DEBUG_PREEMPT
> is enabled.
Is this patched on top of linux-next?
It seems right based on the code usage. Though it makes me sad the resume
code has to hack into the cpu notifiers like that.
Cheers,
Don
>
> [ 168.259429] BUG: using smp_processor_id() in preemptible [00000000] code: pm/1577
> [ 168.259460] caller is lockup_detector_bootcpu_resume+0x8/0x48
> [ 168.259490] [<c001558c>] (unwind_backtrace+0x0/0x11c) from [<c0296874>] (debug_smp_processor_id+0xbc/0xf0)
> [ 168.259521] [<c0296874>] (debug_smp_processor_id+0xbc/0xf0) from [<c0090114>] (lockup_detector_bootcpu_res
> ume+0x8/0x48)
> [ 168.259552] [<c0090114>] (lockup_detector_bootcpu_resume+0x8/0x48) from [<c006facc>] (suspend_devices_and_
> enter+0x1f8/0x358)
> [ 168.259552] [<c006facc>] (suspend_devices_and_enter+0x1f8/0x358) from [<c006fd68>] (pm_suspend+0x13c/0x204
> )
> [ 168.259582] [<c006fd68>] (pm_suspend+0x13c/0x204) from [<c006f0d0>] (state_store+0xb0/0xd4)
> [ 168.259582] [<c006f0d0>] (state_store+0xb0/0xd4) from [<c028a3d8>] (kobj_attr_store+0x14/0x20)
> [ 168.259613] [<c028a3d8>] (kobj_attr_store+0x14/0x20) from [<c014d344>] (sysfs_write_file+0x10c/0x140)
> [ 168.259643] [<c014d344>] (sysfs_write_file+0x10c/0x140) from [<c00f5a88>] (vfs_write+0xb0/0x138)
> [ 168.259643] [<c00f5a88>] (vfs_write+0xb0/0x138) from [<c00f5ce8>] (sys_write+0x3c/0x68)
> [ 168.259674] [<c00f5ce8>] (sys_write+0x3c/0x68) from [<c000e020>] (ret_fast_syscall+0x0/0x48)
> [ 168.260375] Enabling non-boot CPUs ...
>
> Signed-off-by: Ming Lei <ming.lei@canonical.com>
> ---
> kernel/watchdog.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index 69add8a..7ddb11b 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -623,7 +623,7 @@ static struct notifier_block cpu_nfb = {
> */
> void lockup_detector_bootcpu_resume(void)
> {
> - void *cpu = (void *)(long)smp_processor_id();
> + void *cpu = (void *)(long)raw_smp_processor_id();
>
> cpu_callback(&cpu_nfb, CPU_DEAD_FROZEN, cpu);
> cpu_callback(&cpu_nfb, CPU_UP_PREPARE_FROZEN, cpu);
> --
> 1.7.9.5
>
next prev parent reply other threads:[~2012-07-26 19:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-25 4:39 [PATCH] kernel/watchdog.c : fix smp_processor_id() warning Ming Lei
2012-07-26 19:43 ` Don Zickus [this message]
2012-07-27 0:38 ` Ming Lei
2012-07-27 14:37 ` Don Zickus
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=20120726194324.GG5637@redhat.com \
--to=dzickus@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@canonical.com \
--cc=mingo@kernel.org \
--cc=snanda@chromium.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.