mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Hugh Dickins <hugh@veritas.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix bogus hotplug cpu warning
Date: Mon, 27 Aug 2007 11:18:02 -0700	[thread overview]
Message-ID: <20070827111802.8d0a675b.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0708271604440.21853@blonde.wat.veritas.com>

On Mon, 27 Aug 2007 16:06:19 +0100 (BST)
Hugh Dickins <hugh@veritas.com> wrote:

> Fix bogus DEBUG_PREEMPT warning on x86_64, when cpu brought online after
> bootup: current_is_keventd is right to note its use of smp_processor_id
> is preempt-safe, but should use raw_smp_processor_id to avoid the warning.
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>
> 
> --- 2.6.23-rc3-git10/kernel/workqueue.c	2007-07-26 19:49:58.000000000 +0100
> +++ linux/kernel/workqueue.c	2007-08-26 18:59:16.000000000 +0100
> @@ -635,7 +635,7 @@ int keventd_up(void)
>  int current_is_keventd(void)
>  {
>  	struct cpu_workqueue_struct *cwq;
> -	int cpu = smp_processor_id();	/* preempt-safe: keventd is per-cpu */
> +	int cpu = raw_smp_processor_id(); /* preempt-safe: keventd is per-cpu */
>  	int ret = 0;
>  
>  	BUG_ON(!keventd_wq);

But lib/smp_processor_id.c:debug_smp_processor_id() does

	/*
	 * Kernel threads bound to a single CPU can safely use
	 * smp_processor_id():
	 */
	this_mask = cpumask_of_cpu(this_cpu);

	if (cpus_equal(current->cpus_allowed, this_mask))
		goto out;

So I assume that this warning was triggering because some non-keventd,
non-pinned task is calling current_is_keventd()?


So I agree with the patch, but not with its description.

  reply	other threads:[~2007-08-27 18:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-27 15:06 Hugh Dickins
2007-08-27 18:18 ` Andrew Morton [this message]
2007-08-27 20:37   ` Hugh Dickins
2007-08-27 20:52     ` Andrew Morton
2007-08-27 21:09       ` Hugh Dickins

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=20070827111802.8d0a675b.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®