From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756869AbcBQIbO (ORCPT ); Wed, 17 Feb 2016 03:31:14 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:33711 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756826AbcBQIbN (ORCPT ); Wed, 17 Feb 2016 03:31:13 -0500 Date: Wed, 17 Feb 2016 09:31:09 +0100 From: Ingo Molnar To: Byungchul Park Cc: peterz@infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched: remove an unnecessary memory access, rq->cpu in __schedule() Message-ID: <20160217083109.GB1197@gmail.com> References: <1455159578-17256-1-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455159578-17256-1-git-send-email-byungchul.park@lge.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Byungchul Park wrote: > Is there any reason keeping this statement on the code? > > -----8<----- > From d8a387efb8199b69b6464970d6f9fc57cbcf0ab0 Mon Sep 17 00:00:00 2001 > From: Byungchul Park > 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 > --- > 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