public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tiejun Chen <tiejun.chen@windriver.com>
Cc: <tglx@linutronix.de>, <stable-rt@vger.kernel.org>,
	<linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH] pin_current_cpu: move preempt_enable() outside
Date: Wed, 6 Nov 2013 22:53:40 -0500	[thread overview]
Message-ID: <20131106225340.3f01a55b@gandalf.local.home> (raw)
In-Reply-To: <1383793650-7839-1-git-send-email-tiejun.chen@windriver.com>

On Thu, 7 Nov 2013 11:07:30 +0800
Tiejun Chen <tiejun.chen@windriver.com> wrote:

> It should make better sense than before.

But this change log makes no sense.


> 
> Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
> ---
>  kernel/cpu.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index da6e128..7b1853f 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -124,12 +124,11 @@ retry:
>  		return;
>  	}
>  
> +	preempt_enable();
>  	if (hp->grab_lock) {
> -		preempt_enable();

Just because we may enable preemption in both if branches, the decision
for which branch to take must still be determined under preempt
disable, otherwise things may no longer apply.

That said, I'm not sure if it matters if we do enable preemption before
the check or not. But I rather not blindly do so without looking at how
that affects things. There's some subtle races between setting
grab_lock and running the sync_task. It may not matter if we enabled
preemption before the check, but it will take a bit of thought before
that can be decided.


-- Steve

>  		hotplug_lock(hp);
>  		hotplug_unlock(hp);
>  	} else {
> -		preempt_enable();
>  		/*
>  		 * Try to push this task off of this CPU.
>  		 */


      reply	other threads:[~2013-11-07  3:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07  3:07 [PATCH] pin_current_cpu: move preempt_enable() outside Tiejun Chen
2013-11-07  3:53 ` Steven Rostedt [this message]

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=20131106225340.3f01a55b@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=stable-rt@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tiejun.chen@windriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox