Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933461AbcK1RBe (ORCPT ); Mon, 28 Nov 2016 12:01:34 -0500 Received: from mail-wj0-f171.google.com ([209.85.210.171]:33751 "EHLO mail-wj0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932839AbcK1RB1 (ORCPT ); Mon, 28 Nov 2016 12:01:27 -0500 Date: Mon, 28 Nov 2016 17:01:24 +0000 From: Matt Fleming To: Vincent Guittot Cc: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, Morten.Rasmussen@arm.com, dietmar.eggemann@arm.com, kernellwp@gmail.com, yuyang.du@intel.com, umgwanakikbuti@gmail.com Subject: Re: [PATCH 1/2 v2] sched: fix find_idlest_group for fork Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1480088073-11642-2-git-send-email-vincent.guittot@linaro.org> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 30 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?