public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Byungchul Park <byungchul.park@lge.com>
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: remove an unnecessary memory access, rq->cpu in __schedule()
Date: Wed, 17 Feb 2016 09:31:09 +0100	[thread overview]
Message-ID: <20160217083109.GB1197@gmail.com> (raw)
In-Reply-To: <1455159578-17256-1-git-send-email-byungchul.park@lge.com>


* Byungchul Park <byungchul.park@lge.com> wrote:

> Is there any reason keeping this statement on the code?
> 
> -----8<-----
> From d8a387efb8199b69b6464970d6f9fc57cbcf0ab0 Mon Sep 17 00:00:00 2001
> From: Byungchul Park <byungchul.park@lge.com>
> Date: Thu, 11 Feb 2016 11:50:53 +0900
> Subject: [PATCH] sched: remove an unnecessary memory access, rq->cpu in
>  __schedule()
> 
> Remove an unnecessary assignment of variable not used any more.
> 
> Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> ---
>  kernel/sched/core.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 1315cec..501f5d9 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3193,7 +3193,6 @@ static void __sched notrace __schedule(bool preempt)
>  
>  		trace_sched_switch(preempt, prev, next);
>  		rq = context_switch(rq, prev, next); /* unlocks the rq */
> -		cpu = cpu_of(rq);
>  	} else {
>  		lockdep_unpin_lock(&rq->lock);
>  		raw_spin_unlock_irq(&rq->lock);

There's no memory access that I can see - GCC will optimize it out.

Having said that, it is a dead statement so can be removed. I fixed the title 
accordingly.

Thanks,

	Ingo

  reply	other threads:[~2016-02-17  8:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11  2:59 [PATCH] sched: remove an unnecessary memory access, rq->cpu in __schedule() Byungchul Park
2016-02-17  8:31 ` Ingo Molnar [this message]
2016-02-17  8:48   ` Byungchul Park
2016-02-17 12:14 ` [tip:sched/core] sched/core: Remove dead statement in __schedule( ) tip-bot for Byungchul Park

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=20160217083109.GB1197@gmail.com \
    --to=mingo@kernel.org \
    --cc=byungchul.park@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    /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