lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 17 Feb 2016 17:48:27 +0900
From:	Byungchul Park <byungchul.park@....com>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	peterz@...radead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched: remove an unnecessary memory access, rq->cpu in
 __schedule()

On Wed, Feb 17, 2016 at 09:31:09AM +0100, Ingo Molnar wrote:
> 
> * Byungchul Park <byungchul.park@....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@....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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ