From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: 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>
Subject: [patch] Let smp_call_function_single return -EBUSY.
Date: Mon, 14 May 2007 11:23:17 +0200 [thread overview]
Message-ID: <20070514092317.GB8968@osiris.boeblingen.de.ibm.com> (raw)
From: Heiko Carstens <heiko.carstens@de.ibm.com>
All architectures that have an implementation of smp_call_function_single
let it return -EBUSY if it is asked to execute func on the current cpu.
Therefore the UP version must always return -EBUSY.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
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.
include/linux/smp.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Index: linux-2.6/include/linux/smp.h
===================================================================
--- linux-2.6.orig/include/linux/smp.h
+++ linux-2.6/include/linux/smp.h
@@ -99,11 +99,9 @@ static inline void smp_send_reschedule(i
#define num_booting_cpus() 1
#define smp_prepare_boot_cpu() do {} while (0)
static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
- void *info, int retry, int wait)
+ void *info, int retry, int wait)
{
- /* Disable interrupts here? */
- func(info);
- return 0;
+ return -EBUSY;
}
#endif /* !SMP */
next reply other threads:[~2007-05-14 9:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-14 9:23 Heiko Carstens [this message]
2007-05-14 19:11 ` Andrew Morton
2007-05-14 19:18 ` Andrew Morton
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=20070514092317.GB8968@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--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
all inboxes | Powered by JetHome®