public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Heiko Carstens <heiko.carstens@de.ibm.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	randy.dunlap@oracle.com, paulus@samba.org,
	benh@kernel.crashing.org, David Miller <davem@davemloft.net>,
	Andi Kleen <ak@suse.de>
Subject: Re: [patch] Let smp_call_function_single return -EBUSY.
Date: Mon, 14 May 2007 12:18:18 -0700	[thread overview]
Message-ID: <20070514121818.00dfc679.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070514121137.ddcc3f5a.akpm@linux-foundation.org>

On Mon, 14 May 2007 12:11:37 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> > This of course raises another question: it is not clear in which context
> > the smp_call_function* functions are supposed to be called. Should it be
> > with preemption disabled or is preemption enabled allowed as well?
> > If calling with preemption enabled is allowed then the powerpc implementation
> > is broken, since smp_processor_id() as well as num_online_cpus() may change
> > while they are accessed.
> 
> These are all excellent questions.  And important ones.

erk, I see your point.  If a caller is calling this with preemption enabled
then the current thread might at any time migrate onto the target CPU,
causing the smp_call_function_single() attempt to fail.  So the effects of
that call are basically a random crapshoot.

Often but not always, any code which is hanging onto a variable called
"cpu" while preemption enabled is buggy.

So yes, I'd say that from a sanity-of-implementation POV and for general
defensiveness, we should require that the called of
smp_call_function_single() has disabled preemption.

What a crock.

  reply	other threads:[~2007-05-14 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-14  9:23 [patch] Let smp_call_function_single return -EBUSY Heiko Carstens
2007-05-14 19:11 ` Andrew Morton
2007-05-14 19:18   ` Andrew Morton [this message]
2007-05-14 23:24   ` Andi Kleen
2007-06-07 16:04 ` 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=20070514121818.00dfc679.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ak@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=randy.dunlap@oracle.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