Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754839Ab3ETJxo (ORCPT ); Mon, 20 May 2013 05:53:44 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:51287 "EHLO e23smtp08.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752738Ab3ETJxn (ORCPT ); Mon, 20 May 2013 05:53:43 -0400 Message-ID: <5199F1E9.2080002@linux.vnet.ibm.com> Date: Mon, 20 May 2013 15:20:33 +0530 From: "Srivatsa S. Bhat" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 MIME-Version: 1.0 To: Li Zhong CC: LKML , Frederic Weisbecker Subject: Re: [RFC PATCH nohz] return NOTIFY_BAD in cpu down call back to stop offlining the cpu References: <1368780244.2813.14.camel@ThinkPad-T5421> In-Reply-To: <1368780244.2813.14.camel@ThinkPad-T5421> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13052009-5140-0000-0000-0000033C9529 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1666 Lines: 50 On 05/17/2013 02:14 PM, Li Zhong wrote: > 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(), This above line is not relevant here, because notifier_call_chain() doesn't use notifier_to/from_errno(). It simply uses a straight-forward check like this: if ((ret & NOTIFY_STOP_MASK) == NOTIFY_STOP_MASK) break; > 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 > --- Reviewed-by: Srivatsa S. Bhat > 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; > Regards, Srivatsa S. Bhat -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/