Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2588584ybv; Mon, 24 Feb 2020 07:58:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxYCQbfTHrkjwdktyZo5X/nypCWBhqvUr4lpJcjKsF7OLU5GanbFNixEwRZOOXSslqYlFo2 X-Received: by 2002:aca:3f8b:: with SMTP id m133mr12700489oia.51.1582559884586; Mon, 24 Feb 2020 07:58:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582559884; cv=none; d=google.com; s=arc-20160816; b=FjBhmtXfDYF3gB5YL42q9Cz61mV/MDXnUYiOj19SlNqBBeoPeqGHXCpHNhCRoQp7N7 HLTcScdxMn1GK0Ns8OspPp5/XBKqEZHfI7XArR2FbHcqiMfZY23tWLZxunTqk9JFz8Pi McsWkN7jglb6JAMxzpnv0WKb4MksjyKdnqAHNC9jawKnsA8x4Z0krjdFZoHVtv5WvMlE Gv62cVxmQx/2sro6a698OB7RefqXR2ZrmUxzwPmRlYTvKCUnJhL1c1M1w42m/P4R1eLu iQ7p2bX7QUR6OH5h0pJfqbsWOrJ46J0evLNSFNLvAffQAi4W2W1915C67zBWd/FBxiGm rsOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MCOQWcjmjT/ypprTxUDqRR2YRUpps4p7Vfj4Oxl+QGo=; b=e6V+hefkuJY3iAlyvQOcaNGxw828Cv5f6XpLUW/nnJj+n0ac2eIzZ1D9NZqzakC+FT PCh4o76Rt1AeqssZXDMuHURlGcyLLxOqGDBVSk+ABxvzmJEhDb7F7LRFdx7ZMmlztxWR MaI9s1GmruxGPSn60I0vY0PpBbk79bTfn4Ja8nUIW106qUs3TeIfR6wzdFSLNNTg4Nho i3JsPSYILOcPtpMQaGXWD/vxtBvEXLOHXPsrN+ocqSyLk5UashmgMkbrCrkw24AtEmCb l5D8Kv81twPX1vUG6o+QjsxILDD05xvfj6N1sU+IlXHM6FO1LeOu6Q4h0QE+f3ZKGS9+ DEQQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si6415293otk.136.2020.02.24.07.57.50; Mon, 24 Feb 2020 07:58:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727939AbgBXP5k (ORCPT + 99 others); Mon, 24 Feb 2020 10:57:40 -0500 Received: from foss.arm.com ([217.140.110.172]:39180 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727693AbgBXP5k (ORCPT ); Mon, 24 Feb 2020 10:57:40 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 68E031FB; Mon, 24 Feb 2020 07:57:39 -0800 (PST) Received: from [10.1.195.59] (ifrit.cambridge.arm.com [10.1.195.59]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E68813F703; Mon, 24 Feb 2020 07:57:37 -0800 (PST) Subject: Re: [PATCH v3 4/5] sched/pelt: Add a new runnable average signal To: Vincent Guittot Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel , Phil Auld , Parth Shah , Hillf Danton References: <20200214152729.6059-5-vincent.guittot@linaro.org> <20200219125513.8953-1-vincent.guittot@linaro.org> <9fe822fc-c311-2b97-ae14-b9269dd99f1e@arm.com> From: Valentin Schneider Message-ID: Date: Mon, 24 Feb 2020 15:57:36 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I somehow lost track of that email, sorry for the delayed response. On 2/21/20 8:56 AM, Vincent Guittot wrote: > On Thu, 20 Feb 2020 at 17:11, Valentin Schneider > wrote: >> >> On 20/02/2020 14:36, Vincent Guittot wrote: >>> 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 >>> >> >> So that's indeed better for big.LITTLE & co. Any reason however for not >> aligning with the initialization of util_avg ? > > The runnable_avg is the unweighted version of the load_avg so they > should both be sync at init and SCHED_CAPACITY_SCALE is in fact the > right value. Using cpu_scale is the same for smp and big core so we > can use it instead. > > Then, the initial value of util_avg has never reflected some kind of > realistic value for the utilization of a new task, especially if those > tasks will become big ones. Runnable_avg now balances this effect to > say that we don't know what will be the behavior of the new task, > which might end up using all spare capacity although current > utilization is low and CPU is not "fully used". I'd argue that the init values we pick for either runnable_avg or util_avg are both equally bogus. > In fact, this is > exactly the purpose of runnable: highlight that there is maybe no > spare capacity even if CPU's utilization is low because of external > event like task migration or having new tasks with most probably wrong > utilization. > > That being said, there is a bigger problem with the current version of > this patch, which is that I forgot to use runnable in > update_sg_wakeup_stats(). I have a patch that fixes this problem. > > Also, I have tested both proposals with hackbench on my octo cores and > using cpu_scale gives slightly better results than util_avg, which > probably reflects the case I mentioned above. > > grp cpu_scale util_avg improvement > 1 1,191(+/-0.77 %) 1,204(+/-1.16 %) -1.07 % > 4 1,147(+/-1.14 %) 1,195(+/-0.52 %) -4.21 % > 8 1,112(+/-1,52 %) 1,124(+/-1,45 %) -1.12 % > 16 1,163(+/-1.72 %) 1,169(+/-1.58 %) -0,45 % > Interesting, thanks for providing the numbers. I'd be curious to figure out where the difference really stems from, but in the meantime consider me convinced ;)