From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: Increase max lag clamping
Date: Fri, 18 Apr 2025 17:51:15 +0200 [thread overview]
Message-ID: <20250418155115.GI17910@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250418151225.3006867-1-vincent.guittot@linaro.org>
On Fri, Apr 18, 2025 at 05:12:25PM +0200, Vincent Guittot wrote:
> sched_entity lag is currently limited to the maximum between the tick and
> twice the slice. This is too short compared to the maximum custom slice
> that can be set and accumulated by other tasks.
> Clamp the lag to the maximum slice that a task can set. A task A can
> accumulate up to its slice of negative lag while running to parity and
> the other runnable tasks can accumulate the same positive lag while
> waiting to run. This positive lag could be lost during dequeue when
> clamping it to twice task's slice if task A's slice is 100ms and others
> use a smaller value like the default 2.8ms.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> kernel/sched/fair.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index a0c4cd26ee07..1c2c70decb20 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -683,15 +683,17 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)
> * is possible -- by addition/removal/reweight to the tree -- to move V around
> * and end up with a larger lag than we started with.
> *
> - * Limit this to either double the slice length with a minimum of TICK_NSEC
> - * since that is the timing granularity.
> - *
> - * EEVDF gives the following limit for a steady state system:
> + * Limit this to the max allowed custom slice length which is higher than the
> + * timing granularity (the tick) and EEVDF gives the following limit for
> + * a steady state system:
> *
> * -r_max < lag < max(r_max, q)
> *
> * XXX could add max_slice to the augmented data to track this.
> */
Right, its that max_slice XXX there.
I think I've actually done that patch at some point, but I'm not sure
where I've placed it :-)
Anyway, I did poke at that other issue you mentioned at OSPM, where
PREEMPT_SHORT wasn't working quite right.
I've pushed out the patches to queue/sched/exp -- I meant to go post all
that, except I keep getting side-tracked and 0-day people are having
trouble with the hrtick bits in there :-/
next prev parent reply other threads:[~2025-04-18 15:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 15:12 [PATCH] sched/fair: Increase max lag clamping Vincent Guittot
2025-04-18 15:51 ` Peter Zijlstra [this message]
2025-04-22 10:16 ` Peter Zijlstra
2025-04-23 10:19 ` Vincent Guittot
2025-04-29 6:47 ` Vincent Guittot
2026-02-23 10:25 ` [tip: sched/urgent] sched/fair: Fix lag clamp tip-bot2 for Peter Zijlstra
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=20250418155115.GI17910@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@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