Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755172AbdHYKQ4 (ORCPT ); Fri, 25 Aug 2017 06:16:56 -0400 Received: from foss.arm.com ([217.140.101.70]:51854 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754397AbdHYKQz (ORCPT ); Fri, 25 Aug 2017 06:16:55 -0400 From: Brendan Jackman To: Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org Cc: Joel Fernandes , Andres Oportus Subject: [PATCH v2 0/5] sched/fair: Tweaks for select_task_rq_fair slowpath Date: Fri, 25 Aug 2017 11:16:27 +0100 Message-Id: <20170825101632.28065-1-brendan.jackman@arm.com> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1495 Lines: 34 This patchset optimises away an unused comparison, and fixes some corner cases in the find_idlest_group path of select_task_rq_fair. Changes v1 -> v2: - Reworked task affinity checks to avoid repeating them, as per Vincent's suggestion. To avoid excessive indentation this required moving code into its own function, as per PeterZ's suggestion. - Split up the patches. - Altered the caller of find_idlest_group so that it now unconditionally uses find_idlest_group_cpu (formerly find_idlest_cpu). This means that we more often use the maligned "perspective-switching" logic at the bottom of the while(sd) loop, but it also means the task placement algorithm is more consistent between whether the idlest group is local or remote. As mentioned in 5/5 an alternative would be to just initialise @new_cpu to @cpu instead of @prev_cpu (which is what PeterZ suggested in v1 review). In that case, some extra code could be removed in & around find_idlest_group_cpu. Brendan Jackman (5): sched/fair: Move select_task_rq_fair slow-path into its own function sched/fair: Remove unnecessary comparison with -1 sched/fair: Fix find_idlest_group when local group is not allowed sched/fair: Fix use of find_idlest_group when no groups are allowed sched/fair: Fix use of find_idlest_group when local group is idlest. kernel/sched/fair.c | 112 ++++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 51 deletions(-) -- 2.14.1