All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Satyam Sharma <satyam.sharma@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Andi Kleen <andi@firstfloor.org>,
	Alan Cox <alan@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Miller <davem@davemloft.net>
Subject: Re: [PATCH] Make smp_call_function{_single} go WARNING and return -EINVAL on !SMP (was Re: [PATCH] i386/x86_64: NMI watchdog: Protect smp_call_function() within CONFIG_SMP)
Date: Thu, 7 Jun 2007 19:51:27 +0200	[thread overview]
Message-ID: <20070607175127.GA22844@osiris.ibm.com> (raw)
In-Reply-To: <a781481a0706070933ld67e06escaddf1b7be2b017@mail.gmail.com>

> The smp_call_function{_single} functions are used to run
> given function on all {or speicified} *other* CPUs. For
> UP systems, "other" CPUs simply don't exist, so we flag
> such incorrect usage of these functions using a WARNING.

If other cpus don't exist then smp_call_function() should just do
*nothing* (there is no other cpu right?). We don't want to sprinkle
a ton of #ifdef CONFIG_SMP around each smp_call_function().

> Also, -EBUSY is generally returned by arch implementations
> when they find that target_cpu == current_cpu, which is not
> a comparable case to the !SMP case. Use -EINVAL instead,
> similar to what powerpc does for !cpu_online(target), which
> is somewhat more analogous.

No. Current semantics of smp_call_function_single() are that it
returns -EBUSY if called on the *current* cpu. Since on !CONFIG_SMP the
only possible cpu it can be called on is the current one, the only
sane return value is -EBUSY.

  reply	other threads:[~2007-06-07 17:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07 15:48 [PATCH] Make smp_call_function{_single} go WARNING and return -EINVAL on !SMP (was Re: [PATCH] i386/x86_64: NMI watchdog: Protect smp_call_function() within CONFIG_SMP) Satyam Sharma
2007-06-07 16:33 ` Satyam Sharma
2007-06-07 17:51   ` Heiko Carstens [this message]
2007-06-07 17:59     ` Satyam Sharma

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=20070607175127.GA22844@osiris.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=satyam.sharma@gmail.com \
    /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.