Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp745861ybv; Thu, 20 Feb 2020 06:36:42 -0800 (PST) X-Google-Smtp-Source: APXvYqy+ZbAlKgM0GRluaDzNjYTxgaXsqr4orYReA1Am9ULR8JgrHcHNJ2LZqHEFiFQZqi0Xtprl X-Received: by 2002:a9d:634c:: with SMTP id y12mr10058454otk.12.1582209402347; Thu, 20 Feb 2020 06:36:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582209402; cv=none; d=google.com; s=arc-20160816; b=v7Eg3qeiEDG8VG+VsrtUNXAtF3VksUvE0Ww+oqCP9StJEkvuTnJ3FIX5kLlUOZ2S63 E34Mqqz1o7ZqXXonov1aOTmpZVF8jcSAKgbYLQw3z6cb27bqdCnrpln79P3zzwP6bVND 7P0wIsyabVntZFon7C2FvGREbbWSh29GM0vuiilX7D+AY+Dk3WHhUNHtk6RpY1Vgj84T pEdRrwzlRCAHsVfd9KPLGvFEzWacCWBwqmnFVxxEPyVOVVpukdoZ9/TbQyqd8Co8x07b AKCKleym2jqRgIC1p+4R/Q9l+NW0EsqbkNQGyTiSXXKTeyA3OnkfYda2Usfxkn/Y4c88 gGWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=iNU2PjgDfv50dT32BqsNIp3wuvczGu9NfgNw5Wz+0pY=; b=V7gVRobFm4HYsXnfXUZEcDemNFAiLPmQB7pMVogXFzgdaFWSuWzUTBLRWSL6zFjwKO 0+WYvERm3QDzEkEPD4TjfoLgclP1YPekmNuCeJmQJuAHY+I8WOF52yGjTr2maUIvucuk /2e78TejEDh2lloH0Di5KN66eERrC6oLlKfltSny9Dj186wDOf49qcxUgXL+yt94m9ym vhe/8BYSp3aeUAHgVQ8Mv/EiOZdm9Y7Zhx/+EWUCv67Agu0z3inGejr49ckx6zrub/xN zqS9IysBYMosnWTuc6rQWLWYHZ7WcTli1NYLrIn0YC4d6TMlQU7NFfNv+1lmEe0BIPHP /QeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o+GFjCJ7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si1924274otn.140.2020.02.20.06.36.29; Thu, 20 Feb 2020 06:36:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o+GFjCJ7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728105AbgBTOgS (ORCPT + 99 others); Thu, 20 Feb 2020 09:36:18 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37764 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727943AbgBTOgS (ORCPT ); Thu, 20 Feb 2020 09:36:18 -0500 Received: by mail-lj1-f196.google.com with SMTP id q23so4489103ljm.4 for ; Thu, 20 Feb 2020 06:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iNU2PjgDfv50dT32BqsNIp3wuvczGu9NfgNw5Wz+0pY=; b=o+GFjCJ7hMUVDSOpBiJKWaA9NbCQkUqFuTiC+7rEs4lsOxiAiKLDvclu8NqCUl4NZg 8GzQARVM4I33hA4rnn9/xDyMzPxQBNrORgDkw89LYyMQUV2E+62HxTWdT5OTK+X4HULL cbp3+aCk1YQKSXavJUFGFtaTsLSVj6UI53Si6gIINGHz5xk92NSixehK6rCg3S1HKdv6 pJKdnKYPKq8yt0UfP0COjU+G4ZmFECHbeSXmTLpvfgGMHE9vzehugxhn+gl9dKftFGQa j+sycNZjHbiEQjxD3YjzUoKTRQf5ixLGvbuQi0PdV3VlPWux4vDB/U7z4XfH8v5HnNT3 pPLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iNU2PjgDfv50dT32BqsNIp3wuvczGu9NfgNw5Wz+0pY=; b=E7e5HzOTGqcMTIFy6DotpJ7pCD0cfYWWbXkypWq6xQ+oh34VuDB6F+M1dYrmBbdJAY /JW32FmZWfg4TEX8XkrEJVLDWllHZxAS9rFcwJz2Kn0FiQDmCPX08RRfhUOXxlCmDuic iXNFXF9hiSPr11DLdZRQNur39U1Gz+cMQXfswcKyXpOW020Ek1WKaWOx/gZnb8V0AtbR 1/63rExVNA6v3mBjHbOq1ishSL44WgzvqhAXlE53fqQoUep84RtEOzojaQ2AocVmC8pD WCZC/dYmx8+9KGAu2RFcT24bvuJGPzwgsf7jsRwoR80UkRE+53XuowgZOz1cGnaNG/SR tzuw== X-Gm-Message-State: APjAAAUJahoLTgdBqwvq8Rawu7kXlILg2xG4+W35X9ec+ewIiNGCZ2Rk zzv4bHvsl76zhzP1Ed1E7bCO02TU2sjLfDZ5TPqD6w== X-Received: by 2002:a2e:80cc:: with SMTP id r12mr18113734ljg.154.1582209374674; Thu, 20 Feb 2020 06:36:14 -0800 (PST) MIME-Version: 1.0 References: <20200214152729.6059-5-vincent.guittot@linaro.org> <20200219125513.8953-1-vincent.guittot@linaro.org> <9fe822fc-c311-2b97-ae14-b9269dd99f1e@arm.com> In-Reply-To: <9fe822fc-c311-2b97-ae14-b9269dd99f1e@arm.com> From: Vincent Guittot Date: Thu, 20 Feb 2020 15:36:02 +0100 Message-ID: Subject: Re: [PATCH v3 4/5] sched/pelt: Add a new runnable average signal To: Valentin Schneider Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel , Phil Auld , Parth Shah , Hillf Danton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Feb 2020 at 21:10, Valentin Schneider wrote: > > On 19/02/2020 12:55, Vincent Guittot wrote: > > @@ -740,8 +740,10 @@ void init_entity_runnable_average(struct sched_entity *se) > > * Group entities are initialized with zero load to reflect the fact that > > * nothing has been attached to the task group yet. > > */ > > - if (entity_is_task(se)) > > + if (entity_is_task(se)) { > > + sa->runnable_avg = SCHED_CAPACITY_SCALE; > > So this is a comment that's more related to patch 5, but the relevant bit is > here. I'm thinking this initialization might be too aggressive wrt load > balance. This will also give different results between symmetric vs > asymmetric topologies - a single fork() will make a LITTLE CPU group (at the > base domain level) overloaded straight away. That won't happen for bigs or on > symmetric topologies because > > // group_is_overloaded() > sgs->group_capacity * imbalance_pct) < (sgs->group_runnable * 100) > > will be false - it would take more than one task for that to happen (due to > the imbalance_pct). > > So maybe what we want here instead is to mimic what he have for utilization, > i.e. initialize to half the spare capacity of the local CPU. IOW, > conceptually something like this: > > --- > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 99249a2484b4..762717092235 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -740,10 +740,8 @@ void init_entity_runnable_average(struct sched_entity *se) > * Group entities are initialized with zero load to reflect the fact that > * nothing has been attached to the task group yet. > */ > - if (entity_is_task(se)) { > - sa->runnable_avg = SCHED_CAPACITY_SCALE; > + if (entity_is_task(se)) > sa->load_avg = scale_load_down(se->load.weight); > - } > > /* when this task enqueue'ed, it will contribute to its cfs_rq's load_avg */ > } > @@ -796,6 +794,8 @@ void post_init_entity_util_avg(struct task_struct *p) > } > } > > + sa->runnable_avg = sa->util_avg; > + > if (p->sched_class != &fair_sched_class) { > /* > * For !fair tasks do: > --- > > The current approach has the merit of giving some sort of hint to the LB > that there is a bunch of new tasks that it could spread out, but I fear it > is too aggressive. I agree that setting by default to SCHED_CAPACITY_SCALE is too much for little core. The problem for little core can be fixed by using the cpu capacity instead @@ -796,6 +794,8 @@ void post_init_entity_util_avg(struct task_struct *p) } } + sa->runnable_avg = cpu_scale; + if (p->sched_class != &fair_sched_class) { /* * For !fair tasks do: > > > sa->load_avg = scale_load_down(se->load.weight); > > + } > > > > /* when this task enqueue'ed, it will contribute to its cfs_rq's load_avg */ > > }