All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [RFC PATCH nohz] return NOTIFY_BAD in cpu down call back to stop offlining the cpu
Date: Mon, 20 May 2013 15:20:33 +0530	[thread overview]
Message-ID: <5199F1E9.2080002@linux.vnet.ibm.com> (raw)
In-Reply-To: <1368780244.2813.14.camel@ThinkPad-T5421>

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 <zhong@linux.vnet.ibm.com>
> ---

Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@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;
> 
 
Regards,
Srivatsa S. Bhat


  reply	other threads:[~2013-05-20  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-05-20 10:12   ` Frederic Weisbecker

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=5199F1E9.2080002@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhong@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.