Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754812AbcK1RVY (ORCPT ); Mon, 28 Nov 2016 12:21:24 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:33471 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754710AbcK1RUl (ORCPT ); Mon, 28 Nov 2016 12:20:41 -0500 MIME-Version: 1.0 In-Reply-To: <20161128170124.GA20785@codeblueprint.co.uk> References: <1480088073-11642-1-git-send-email-vincent.guittot@linaro.org> <1480088073-11642-2-git-send-email-vincent.guittot@linaro.org> <20161128170124.GA20785@codeblueprint.co.uk> From: Vincent Guittot Date: Mon, 28 Nov 2016 18:20:02 +0100 Message-ID: Subject: Re: [PATCH 1/2 v2] sched: fix find_idlest_group for fork To: Matt Fleming Cc: Peter Zijlstra , Ingo Molnar , linux-kernel , Morten Rasmussen , Dietmar Eggemann , Wanpeng Li , Yuyang Du , Mike Galbraith Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1367 Lines: 33 On 28 November 2016 at 18:01, Matt Fleming wrote: > On Fri, 25 Nov, at 04:34:32PM, Vincent Guittot wrote: >> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index aa47589..820a787 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -5463,13 +5463,19 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, >> * utilized systems if we require spare_capacity > task_util(p), >> * so we allow for some task stuffing by using >> * spare_capacity > task_util(p)/2. >> + * spare capacity can't be used for fork because the utilization has >> + * not been set yet as it need to get a rq to init the utilization >> */ >> + if (sd_flag & SD_BALANCE_FORK) >> + goto no_spare; >> + >> if (this_spare > task_util(p) / 2 && >> imbalance*this_spare > 100*most_spare) >> return NULL; >> else if (most_spare > task_util(p) / 2) >> return most_spare_sg; >> >> +no_spare: >> if (!idlest || 100*this_load < imbalance*min_load) >> return NULL; >> return idlest; > > It's only a minor comment, but would you be opposed to calling this > label 'skip_spare' to indicate that spare capacity may exist, but > we're not going to make use of it? you're right, 'skip_spare' makes more sense