mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Remove WARN_ON_ONCE in __smp_call_function_single and smp_call_function_single
@ 2013-01-05  4:26 Hui Zhu
  2013-01-05  8:31 ` Li Zhong
  0 siblings, 1 reply; 3+ messages in thread
From: Hui Zhu @ 2013-01-05  4:26 UTC (permalink / raw)
  To: Peter Zijlstra, Thomas Gleixner, Andrew Morton,
	Michal Nazarewicz, Srivatsa S. Bhat, linux-kernel
  Cc: Zhu Yanhai

The comments of these WARN_ON_ONCE said "Can deadlock when called with
interrupts disabled".
But I didn't find anything that will block this function.

So I think maybe this WARN_ON_ONCE is not need now.  So I post a patch for that.

Signed-off-by: Hui Zhu <teawater@gmail.com>
Signed-off-by: Zhu Yanhai <gaoyang.zyh@taobao.com>

--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -303,25 +303,13 @@ int smp_call_function_single(int cpu, sm
 		.flags = 0,
 	};
 	unsigned long flags;
-	int this_cpu;
 	int err = 0;

 	/*
 	 * prevent preemption and reschedule on another processor,
 	 * as well as CPU removal
 	 */
-	this_cpu = get_cpu();
-
-	/*
-	 * Can deadlock when called with interrupts disabled.
-	 * We allow cpu's that are not yet online though, as no one else can
-	 * send smp call function interrupt to this cpu and as such deadlocks
-	 * can't happen.
-	 */
-	WARN_ON_ONCE(cpu_online(this_cpu) && irqs_disabled()
-		     && !oops_in_progress);
-
-	if (cpu == this_cpu) {
+	if (cpu == get_cpu()) {
 		local_irq_save(flags);
 		func(info);
 		local_irq_restore(flags);
@@ -409,17 +397,7 @@ void __smp_call_function_single(int cpu,
 	unsigned int this_cpu;
 	unsigned long flags;

-	this_cpu = get_cpu();
-	/*
-	 * Can deadlock when called with interrupts disabled.
-	 * We allow cpu's that are not yet online though, as no one else can
-	 * send smp call function interrupt to this cpu and as such deadlocks
-	 * can't happen.
-	 */
-	WARN_ON_ONCE(cpu_online(smp_processor_id()) && wait && irqs_disabled()
-		     && !oops_in_progress);
-
-	if (cpu == this_cpu) {
+	if (cpu == get_cpu()) {
 		local_irq_save(flags);
 		data->func(data->info);
 		local_irq_restore(flags);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-08  1:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-05  4:26 [PATCH] Remove WARN_ON_ONCE in __smp_call_function_single and smp_call_function_single Hui Zhu
2013-01-05  8:31 ` Li Zhong
2013-01-08  1:57   ` Hui Zhu

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®