From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932938AbdBPRgY (ORCPT ); Thu, 16 Feb 2017 12:36:24 -0500 Received: from mail-qk0-f170.google.com ([209.85.220.170]:33982 "EHLO mail-qk0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932465AbdBPRgX (ORCPT ); Thu, 16 Feb 2017 12:36:23 -0500 Subject: Re: [PATCH v3 2/2] sched/rt: Remove unnecessary condition in push_rt_task() To: Byungchul Park , peterz@infradead.org, mingo@kernel.org References: <1487212457-28839-1-git-send-email-byungchul.park@lge.com> <1487212457-28839-2-git-send-email-byungchul.park@lge.com> Cc: linux-kernel@vger.kernel.org, juri.lelli@gmail.com, rostedt@goodmis.org, kernel-team@lge.com From: Daniel Bristot de Oliveira Message-ID: Date: Thu, 16 Feb 2017 18:36:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1487212457-28839-2-git-send-email-byungchul.park@lge.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/16/2017 03:34 AM, Byungchul Park wrote: > 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 code simpler. > > 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) > Reviewed-by: Juri Lelli +1 Reviewed-by: Daniel Bristot de Oliveira -- Daniel