Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6267988ybv; Tue, 18 Feb 2020 13:20:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwdXRusvO0W2yVUr+SAkOmQO/OCXe9HcC6KFHEM0/G2OGCxm76NcdKPjpTjWpGo+ROjDhhB X-Received: by 2002:a05:6830:1e6b:: with SMTP id m11mr17827330otr.293.1582060839246; Tue, 18 Feb 2020 13:20:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582060839; cv=none; d=google.com; s=arc-20160816; b=E6mUsrgvJtOCHuwnb/BI0CYfChBVtyBJAvOH4W34DpmI61E/gBldqikshskrhI9S1b jRlkg5Uq84kWqpxvnO4WuU3jZ8Zsks4bjcNxo1gKgIvcwXnpwu7sGQsqO9uEERoa4OFJ q9Vgi+Uk1SCV5MatnAwGZaGoPS5L4Cc0km+BqQZRikmpZgVaOf+CiicG3vZg/+SS54Zn ljUpf9JtIb+U45OW9MhZbepadV8wrsbmakeiKwbHSIjfqv53orcDctNjWQan+MbERDoB szaUvYZdhp9+k7Guvh5VJWwpV5e88ZMktf0lUTHP4XHdRCzEFM1TKgJfq3XIP7zvXFv4 EtbA== 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=HHhbuQzJW4YmNHU7rjnxUC8fzzvRNYHmIhnT95qC9dE=; b=XHMtntDcfxhIhdHjvH0izrJqZQlSLaTx9sb3jwY6Vw5YoJU+EVW/Fx6OWcP5yteHX7 6ZvIKvTC0FiaiXEONjzJYgcqVnTVP4zK3MNj9cG3sJk+TprT553cMZ4IreIkVOxXXrcF l3cqQNjnLsSB4gOQuC/NHnWPiDiYhPt1hEF7ZhkVgtgWhgYcnigb7hGrjq00ulbZhk0M 1qhv06SdcF+KwUlNM76UIb4JuezBD9Xrpx0TOgW79+LyaeRhuetzKRNVr3iv26ps+iAl UswgEfCwZQm3PORYqUdu+eJT93jaHZNglls4K7LLoYgFRAMB/fzBVr+ZIKCC9h1BNWSm PO2w== 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 c10si5335ots.106.2020.02.18.13.20.26; Tue, 18 Feb 2020 13:20:39 -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 S1727103AbgBRVT5 (ORCPT + 99 others); Tue, 18 Feb 2020 16:19:57 -0500 Received: from foss.arm.com ([217.140.110.172]:34482 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbgBRVT5 (ORCPT ); Tue, 18 Feb 2020 16:19:57 -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 A43351FB; Tue, 18 Feb 2020 13:19:56 -0800 (PST) Received: from [10.0.2.15] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D952D3F68F; Tue, 18 Feb 2020 13:19:54 -0800 (PST) Subject: Re: [PATCH v2 4/5] sched/pelt: Add a new runnable average signal To: Vincent Guittot , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org Cc: pauld@redhat.com, parth@linux.ibm.com, hdanton@sina.com References: <20200214152729.6059-1-vincent.guittot@linaro.org> <20200214152729.6059-5-vincent.guittot@linaro.org> From: Valentin Schneider Message-ID: <4cda8dc3-f6bb-2896-c899-65eadd5c839d@arm.com> Date: Tue, 18 Feb 2020 21:19:16 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200214152729.6059-5-vincent.guittot@linaro.org> 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 On 14/02/2020 15:27, Vincent Guittot wrote: > Now that runnable_load_avg has been removed, we can replace it by a new > signal that will highlight the runnable pressure on a cfs_rq. This signal > track the waiting time of tasks on rq and can help to better define the > state of rqs. > > At now, only util_avg is used to define the state of a rq: > A rq with more that around 80% of utilization and more than 1 tasks is > considered as overloaded. > > But the util_avg signal of a rq can become temporaly low after that a task > migrated onto another rq which can bias the classification of the rq. > > When tasks compete for the same rq, their runnable average signal will be > higher than util_avg as it will include the waiting time and we can use > this signal to better classify cfs_rqs. > > The new runnable_avg will track the runnable time of a task which simply > adds the waiting time to the running time. The runnable _avg of cfs_rq > will be the /Sum of se's runnable_avg and the runnable_avg of group entity > will follow the one of the rq similarly to util_avg. > I did a bit of playing around with tracepoints and it seems to be behaving fine. For instance, if I spawn 12 always runnable tasks (sysbench --test=cpu) on my Juno (6 CPUs), I get to a system-wide runnable value (\Sum cpu_runnable()) of about 12K. I've only eyeballed them, but migration of the signal values seem fine too. I have a slight worry that the rq-wide runnable signal might be too easy to inflate, since we aggregate for *all* runnable tasks, and that may not play well with your group_is_overloaded() change (despite having the imbalance_pct on the "right" side). In any case I'll need to convince myself of it with some messing around, and this concerns patch 5 more than patch 4. So FWIW for this one: Tested-by: Valentin Schneider I also have one (two) more nit(s) below. > Signed-off-by: Vincent Guittot > --- > diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c > @@ -227,14 +231,14 @@ ___update_load_sum(u64 now, struct sched_avg *sa, > * Step 1: accumulate *_sum since last_update_time. If we haven't > * crossed period boundaries, finish. > */ > - if (!accumulate_sum(delta, sa, load, running)) > + if (!accumulate_sum(delta, sa, load, runnable, running)) > return 0; > > return 1; > } > > static __always_inline void > -___update_load_avg(struct sched_avg *sa, unsigned long load) > +___update_load_avg(struct sched_avg *sa, unsigned long load, unsigned long runnable) > { > u32 divider = LOAD_AVG_MAX - 1024 + sa->period_contrib; > > @@ -242,6 +246,7 @@ ___update_load_avg(struct sched_avg *sa, unsigned long load) > * Step 2: update *_avg. > */ > sa->load_avg = div_u64(load * sa->load_sum, divider); > + sa->runnable_avg = div _u64(runnable * sa->runnable_sum, divider); ^^^^^^ ^^^^^^^^ a) b) a) That's a tab b) The value being passed is always 1, do we really need it to expose it as a parameter?