public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Sasikantha babu <sasikanth.v19@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	Frank Rowand <frank.rowand@am.sony.com>,
	Paul Turner <pjt@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: Removed redundant set_current_state in "yield"
Date: Mon, 07 May 2012 15:13:36 +0200	[thread overview]
Message-ID: <1336396416.27020.44.camel@laptop> (raw)
In-Reply-To: <1334072733-2614-1-git-send-email-sasikanth.v19@gmail.com>

On Tue, 2012-04-10 at 21:15 +0530, Sasikantha babu wrote:
> Removed redundant setting current task state to TASK_RUNNING.
> 
> During yield process will always remains in TASK_RUNNING state. 

Uhm, no, if you call yield() with !TASK_RUNNING you'll block and need a
proper wakeup. That is, you can in fact abuse yield() as schedule().

> Process state of  yielded process will not change from TASK_RUNNING, so it does not 
> make sense setting the process state again to TASK_RUNNING (TASK_RUNNING -> TASK_RUNNING).

No real objections, but have you tested/verified that all users are
indeed unaffected by this change?

> Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>
> ---
>  kernel/sched/core.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 4603b9d..c2a357d 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -4624,7 +4624,6 @@ EXPORT_SYMBOL(__cond_resched_softirq);
>   */
>  void __sched yield(void)
>  {
> -	set_current_state(TASK_RUNNING);
>  	sys_sched_yield();
>  }
>  EXPORT_SYMBOL(yield);




  reply	other threads:[~2012-05-07 13:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 15:45 [PATCH] sched: Removed redundant set_current_state in "yield" Sasikantha babu
2012-05-07 13:13 ` Peter Zijlstra [this message]
2012-05-08 13:33   ` Sasikanth babu

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=1336396416.27020.44.camel@laptop \
    --to=a.p.zijlstra@chello.nl \
    --cc=frank.rowand@am.sony.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pjt@google.com \
    --cc=sasikanth.v19@gmail.com \
    --cc=tglx@linutronix.de \
    /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