From: Byungchul Park <byungchul.park@lge.com>
To: Ingo Molnar <mingo@kernel.org>
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 17:48:27 +0900 [thread overview]
Message-ID: <20160217084827.GD5972@X58A-UD3R> (raw)
In-Reply-To: <20160217083109.GB1197@gmail.com>
On Wed, Feb 17, 2016 at 09:31:09AM +0100, Ingo Molnar wrote:
>
> * 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.
Yes, gcc will do it. So I expect no performance effect.
>
> Having said that, it is a dead statement so can be removed. I fixed the title
> accordingly.
Thank you.
>
> Thanks,
>
> Ingo
next prev parent reply other threads:[~2016-02-17 8:49 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
2016-02-17 8:48 ` Byungchul Park [this message]
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=20160217084827.GD5972@X58A-UD3R \
--to=byungchul.park@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@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;
as well as URLs for NNTP newsgroup(s).