mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hongyan Xia <hongyan.xia2@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: lukasz.luba@arm.com, mingo@redhat.com, mgorman@suse.de,
	rostedt@goodmis.org, bristot@redhat.com, peterz@infradead.org,
	rafael@kernel.org, vschneid@redhat.com, dietmar.eggemann@arm.com,
	juri.lelli@redhat.com, bsegall@google.com, qyousef@layalina.io,
	viresh.kumar@linaro.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] sched/pelt: avoid underestimate of task utilization
Date: Fri, 24 Nov 2023 10:43:59 +0000	[thread overview]
Message-ID: <4a005396-46fd-443c-be15-6fe0e2a1dea5@arm.com> (raw)
In-Reply-To: <20231122140119.472110-1-vincent.guittot@linaro.org>

On 22/11/2023 14:01, Vincent Guittot wrote:
> [...]
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 07f555857698..eeb505d28905 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4774,6 +4774,11 @@ static inline unsigned long task_util(struct task_struct *p)
>   	return READ_ONCE(p->se.avg.util_avg);
>   }
>   
> +static inline unsigned long task_runnable(struct task_struct *p)
> +{
> +	return READ_ONCE(p->se.avg.runnable_avg);
> +}
> +
>   static inline unsigned long _task_util_est(struct task_struct *p)
>   {
>   	struct util_est ue = READ_ONCE(p->se.avg.util_est);
> @@ -4892,6 +4897,14 @@ static inline void util_est_update(struct cfs_rq *cfs_rq,
>   	if (task_util(p) > arch_scale_cpu_capacity(cpu_of(rq_of(cfs_rq))))
>   		return;
>   
> +	/*
> +	 * To avoid underestimate of task utilization, skip updates of ewma if
> +	 * we cannot grant that thread got all CPU time it wanted.
> +	 */
> +	if ((ue.enqueued + UTIL_EST_MARGIN) < task_runnable(p))
> +		goto done;
> +
> +

Actually, does this also skip util_est increases as well, assuming no 
FASTUP? When a task is ramping up, another task could join and then 
blocks this task from ramping up its util_est.

Or do we think this is intended behavior for !FASTUP?

>   	/*
>   	 * Update Task's estimated utilization
>   	 *

  parent reply	other threads:[~2023-11-24 10:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 14:01 Vincent Guittot
2023-11-21 23:01 ` Qais Yousef
2023-11-23 14:27   ` Lukasz Luba
2023-11-23 16:45     ` Qais Yousef
2023-11-22 16:40 ` Hongyan Xia
     [not found]   ` <CAKfTPtAosL8f0M1nL2U78iuwm9ZFGuQS5jX4soex8nsGjMX_RQ@mail.gmail.com>
2023-11-22 17:37     ` Vincent Guittot
2023-11-24 10:34       ` Hongyan Xia
2023-11-23 10:30 ` [tip: sched/core] sched/pelt: Avoid underestimation " tip-bot2 for Vincent Guittot
2023-11-23 13:13 ` [PATCH] sched/pelt: avoid underestimate " Lukasz Luba
2023-11-24 10:43 ` Hongyan Xia [this message]
2023-11-24 12:04   ` Vincent Guittot

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=4a005396-46fd-443c-be15-6fe0e2a1dea5@arm.com \
    --to=hongyan.xia2@arm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qyousef@layalina.io \
    --cc=rafael@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    --cc=vschneid@redhat.com \
    /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®