From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966926AbdEWIsm (ORCPT ); Tue, 23 May 2017 04:48:42 -0400 Received: from terminus.zytor.com ([65.50.211.136]:35685 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966910AbdEWIsi (ORCPT ); Tue, 23 May 2017 04:48:38 -0400 Date: Tue, 23 May 2017 01:44:50 -0700 From: tip-bot for Byungchul Park Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, byungchul.park@lge.com, mingo@kernel.org, bristot@redhat.com, torvalds@linux-foundation.org, kernel-team@lge.com, tglx@linutronix.de, rostedt@goodmis.org, juri.lelli@arm.com Reply-To: linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, byungchul.park@lge.com, mingo@kernel.org, torvalds@linux-foundation.org, kernel-team@lge.com, bristot@redhat.com, tglx@linutronix.de, rostedt@goodmis.org, juri.lelli@arm.com In-Reply-To: <1494551143-22219-1-git-send-email-byungchul.park@lge.com> References: <1494551143-22219-1-git-send-email-byungchul.park@lge.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/rt: Remove unnecessary condition in push_rt_task() Git-Commit-ID: de16b91effdbf5aeff8346b99bcd0991a5362db9 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: de16b91effdbf5aeff8346b99bcd0991a5362db9 Gitweb: http://git.kernel.org/tip/de16b91effdbf5aeff8346b99bcd0991a5362db9 Author: Byungchul Park AuthorDate: Fri, 12 May 2017 10:05:43 +0900 Committer: Ingo Molnar CommitDate: Tue, 23 May 2017 10:01:33 +0200 sched/rt: Remove unnecessary condition in push_rt_task() pick_next_pushable_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. Remove the redundant condition and make the code simpler. This way one unnecessary branch and two LOAD operations can be avoided. Signed-off-by: Byungchul Park Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Steven Rostedt (VMware) Reviewed-by: Juri Lelli Reviewed-by: Daniel Bristot de Oliveira Cc: Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1494551143-22219-1-git-send-email-byungchul.park@lge.com Signed-off-by: Ingo Molnar --- kernel/sched/rt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 979b734..c18b500 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1819,7 +1819,7 @@ retry: * pushing. */ task = pick_next_pushable_task(rq); - if (task_cpu(next_task) == rq->cpu && task == next_task) { + if (task == next_task) { /* * The task hasn't migrated, and is still the next * eligible task, but we failed to find a run-queue