mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Satyam Sharma" <satyam.sharma@gmail.com>
To: "Heiko Carstens" <heiko.carstens@de.ibm.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 23:29:55 +0530	[thread overview]
Message-ID: <a781481a0706071059g7502f18co56cbb30477acf92f@mail.gmail.com> (raw)
In-Reply-To: <20070607175127.GA22844@osiris.ibm.com>

On 6/7/07, Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> > 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().

Yes, I suspected that, as mentioned on the other thread (ugh).

> > 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.

The inherent assumption that on !SMP the only possible CPU it
can be called on is current (== 0) is precisely what I would want
to be asserted formally in the code over here. If so, then return
-EBUSY, else -EINVAL?

      reply	other threads:[~2007-06-07 18:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07 15:48 Satyam Sharma
2007-06-07 16:33 ` Satyam Sharma
2007-06-07 17:51   ` Heiko Carstens
2007-06-07 17:59     ` Satyam Sharma [this message]

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