From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753243AbdBPCec (ORCPT ); Wed, 15 Feb 2017 21:34:32 -0500 Received: from smtprelay0050.hostedemail.com ([216.40.44.50]:58303 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752895AbdBPCeb (ORCPT ); Wed, 15 Feb 2017 21:34:31 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3353:3622:3865:3868:3870:3871:3872:3874:4250:4321:5007:6119:6261:7875:7903:7974:10004:10400:10848:10967:11026:11232:11658:11914:12043:12296:12438:12555:12740:12760:12895:12986:13069:13255:13311:13357:13439:14096:14097:14181:14659:14721:21080:21325:21451:30012:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: drink58_444d14ea74c1d X-Filterd-Recvd-Size: 2386 Date: Wed, 15 Feb 2017 21:34:28 -0500 From: Steven Rostedt To: Byungchul Park Cc: , , , , Subject: Re: [PATCH v2 1/2] sched/deadline: Remove unnecessary condition in push_dl_task() Message-ID: <20170215213428.3b78ef59@grimm.local.home> In-Reply-To: <1487210754-17252-1-git-send-email-byungchul.park@lge.com> References: <1487210754-17252-1-git-send-email-byungchul.park@lge.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Feb 2017 11:05:53 +0900 Byungchul Park wrote: > Once pick_next_pushable_dl_task(rq) returns a task, it guarantees that > the task's cpu is rq->cpu, so task_cpu(next_task) is always rq->cpu if > task == next_task. Remove the redundant condition and make code simpler. > > pick_next_pushable_dl_task(rq) has BUG_ON(rq->cpu != task_cpu(task)) > when it returns a task other than NULL, which means that task_cpu(task) > must be rq->cpu. So if task == next_task, then task_cpu(next_task) must > be rq->cpu as well. > > By this patch, unnecessary one branch and two LOAD operations in 'if' > statement can be avoided. > > Signed-off-by: Byungchul Park Reviewed-by: Steven Rostedt (VMware) -- Steve > --- > kernel/sched/deadline.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > index 27737f3..ad8d577 100644 > --- a/kernel/sched/deadline.c > +++ b/kernel/sched/deadline.c > @@ -1483,7 +1483,7 @@ static int push_dl_task(struct rq *rq) > * then possible that next_task has migrated. > */ > task = pick_next_pushable_dl_task(rq); > - if (task_cpu(next_task) == rq->cpu && task == next_task) { > + if (task == next_task) { > /* > * The task is still there. We don't try > * again, some other cpu will pull it when ready.