diff options
author | Andrew Morton <akpm@osdl.org> | 2006-03-22 03:08:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:53:59 -0500 |
commit | 78eef01b0fae087c5fadbd85dd4fe2918c3a015f (patch) | |
tree | 78057039596aa733ff904a36260cca3a51af6981 /arch/i386/kernel/smp.c | |
parent | ac2b898ca6fb06196a26869c23b66afe7944e52e (diff) |
[PATCH] on_each_cpu(): disable local interrupts
When on_each_cpu() runs the callback on other CPUs, it runs with local
interrupts disabled. So we should run the function with local interrupts
disabled on this CPU, too.
And do the same for UP, so the callback is run in the same environment on both
UP and SMP. (strictly it should do preempt_disable() too, but I think
local_irq_disable is sufficiently equivalent).
Also uninlines on_each_cpu(). softirq.c was the most appropriate file I could
find, but it doesn't seem to justify creating a new file.
Oh, and fix up that comment over (under?) x86's smp_call_function(). It
drives me nuts.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/smp.c')
-rw-r--r-- | arch/i386/kernel/smp.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index 218d725a5a1e..d134e9643a58 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c | |||
@@ -504,27 +504,23 @@ void unlock_ipi_call_lock(void) | |||
504 | spin_unlock_irq(&call_lock); | 504 | spin_unlock_irq(&call_lock); |
505 | } | 505 | } |
506 | 506 | ||
507 | static struct call_data_struct * call_data; | 507 | static struct call_data_struct *call_data; |
508 | 508 | ||
509 | /* | 509 | /** |
510 | * this function sends a 'generic call function' IPI to all other CPUs | 510 | * smp_call_function(): Run a function on all other CPUs. |
511 | * in the system. | 511 | * @func: The function to run. This must be fast and non-blocking. |
512 | */ | 512 | * @info: An arbitrary pointer to pass to the function. |
513 | 513 | * @nonatomic: currently unused. | |
514 | int smp_call_function (void (*func) (void *info), void *info, int nonatomic, | 514 | * @wait: If true, wait (atomically) until function has completed on other CPUs. |
515 | int wait) | 515 | * |
516 | /* | 516 | * Returns 0 on success, else a negative status code. Does not return until |
517 | * [SUMMARY] Run a function on all other CPUs. | ||
518 | * <func> The function to run. This must be fast and non-blocking. | ||
519 | * <info> An arbitrary pointer to pass to the function. | ||
520 | * <nonatomic> currently unused. | ||
521 | * <wait> If true, wait (atomically) until function has completed on other CPUs. | ||
522 | * [RETURNS] 0 on success, else a negative status code. Does not return until | ||
523 | * remote CPUs are nearly ready to execute <<func>> or are or have executed. | 517 | * remote CPUs are nearly ready to execute <<func>> or are or have executed. |
524 | * | 518 | * |
525 | * You must not call this function with disabled interrupts or from a | 519 | * You must not call this function with disabled interrupts or from a |
526 | * hardware interrupt handler or from a bottom half handler. | 520 | * hardware interrupt handler or from a bottom half handler. |
527 | */ | 521 | */ |
522 | int smp_call_function (void (*func) (void *info), void *info, int nonatomic, | ||
523 | int wait) | ||
528 | { | 524 | { |
529 | struct call_data_struct data; | 525 | struct call_data_struct data; |
530 | int cpus; | 526 | int cpus; |