public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH nohz] return NOTIFY_BAD in cpu down call back to stop offlining the cpu
@ 2013-05-17  8:44 Li Zhong
  2013-05-20  9:50 ` Srivatsa S. Bhat
  0 siblings, 1 reply; 3+ messages in thread
From: Li Zhong @ 2013-05-17  8:44 UTC (permalink / raw)
  To: LKML; +Cc: Frederic Weisbecker

In tick_nohz_cpu_down_callback() if the cpu is the one handling
timekeeping , it seems that we should return something that could stop
notify CPU_DOWN_PREPARE, and then start notify CPU_DOWN_FAILED on the
already called notifier call backs.

-EINVAL will be converted to 0 by notifier_to_errno(), then the cpu
would be taken down with part of the DOWN_PREPARE notifier callbacks
called, and something bad could happen after that.

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
---
 kernel/time/tick-sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index bc67d42..17b8155 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -306,7 +306,7 @@ static int __cpuinit tick_nohz_cpu_down_callback(struct notifier_block *nfb,
 		 * we can't safely shutdown that CPU.
 		 */
 		if (have_nohz_full_mask && tick_do_timer_cpu == cpu)
-			return -EINVAL;
+			return NOTIFY_BAD;
 		break;
 	}
 	return NOTIFY_OK;
-- 
1.7.1


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

end of thread, other threads:[~2013-05-20 10:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-17  8:44 [RFC PATCH nohz] return NOTIFY_BAD in cpu down call back to stop offlining the cpu Li Zhong
2013-05-20  9:50 ` Srivatsa S. Bhat
2013-05-20 10:12   ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox