mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valentin Schneider <valentin.schneider@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>,
	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
Subject: Re: [PATCH v2 4/5] sched/pelt: Add a new runnable average signal
Date: Tue, 18 Feb 2020 21:19:16 +0000	[thread overview]
Message-ID: <4cda8dc3-f6bb-2896-c899-65eadd5c839d@arm.com> (raw)
In-Reply-To: <20200214152729.6059-5-vincent.guittot@linaro.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 <valentin.schneider@arm.com>

I also have one (two) more nit(s) below.

> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> 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?

  parent reply	other threads:[~2020-02-18 21:19 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 15:27 [PATCH v2 0/5] remove runnable_load_avg and improve group_classify Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 1/5] sched/fair: Reorder enqueue/dequeue_task_fair path Vincent Guittot
2020-02-18 12:37   ` Dietmar Eggemann
2020-02-18 13:22     ` Peter Zijlstra
2020-02-18 14:15       ` Vincent Guittot
2020-02-19 11:07         ` Dietmar Eggemann
2020-02-19 16:26           ` Vincent Guittot
2020-02-20 13:38             ` Dietmar Eggemann
     [not found]               ` <20200222152541.GA11669@geo.homenetwork>
2020-02-26 16:30                 ` Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 2/5] sched/numa: Replace runnable_load_avg by load_avg Vincent Guittot
2020-02-18 12:37   ` Dietmar Eggemann
2020-02-18 13:50     ` Mel Gorman
2020-02-18 14:17       ` Vincent Guittot
2020-02-18 14:42         ` Dietmar Eggemann
2020-02-18 14:54   ` Valentin Schneider
2020-02-18 15:33     ` Vincent Guittot
2020-02-18 15:38     ` Mel Gorman
2020-02-18 16:50       ` Valentin Schneider
2020-02-18 17:41         ` Mel Gorman
2020-02-18 17:54           ` Valentin Schneider
2020-02-18 16:51       ` Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 3/5] sched/pelt: Remove unused runnable load average Vincent Guittot
2020-02-21  9:57   ` Dietmar Eggemann
2020-02-21 11:56     ` Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 4/5] sched/pelt: Add a new runnable average signal Vincent Guittot
2020-02-18 14:54   ` Valentin Schneider
2020-02-18 15:12     ` Peter Zijlstra
2020-02-18 15:28     ` Vincent Guittot
2020-02-18 16:30       ` Valentin Schneider
2020-02-18 21:19   ` Valentin Schneider [this message]
2020-02-19  9:02     ` Vincent Guittot
2020-02-19  9:08     ` Mel Gorman
2020-02-19 12:55   ` [PATCH v3 " Vincent Guittot
2020-02-19 14:02     ` Mel Gorman
2020-02-19 20:10     ` Valentin Schneider
2020-02-20 14:36       ` Vincent Guittot
2020-02-20 16:11         ` Valentin Schneider
2020-02-21  8:56           ` Vincent Guittot
2020-02-24 15:57             ` Valentin Schneider
2020-02-21  9:04           ` Mel Gorman
2020-02-21  9:25             ` Vincent Guittot
2020-02-21 10:40               ` Mel Gorman
2020-02-21 13:28                 ` Vincent Guittot
2020-02-20 15:04     ` Dietmar Eggemann
2020-02-21  9:44     ` Dietmar Eggemann
2020-02-21 11:47       ` Vincent Guittot
2020-02-14 15:27 ` [PATCH v2 5/5] sched/fair: Take into account runnable_avg to classify group Vincent Guittot
2020-02-15 21:58 ` [PATCH v2 0/5] remove runnable_load_avg and improve group_classify Mel Gorman
2020-02-21  9:58 ` Dietmar Eggemann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4cda8dc3-f6bb-2896-c899-65eadd5c839d@arm.com \
    --to=valentin.schneider@arm.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hdanton@sina.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=parth@linux.ibm.com \
    --cc=pauld@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®