From: Kayra Cizmeci <kayracizmeci@gmail.com>
To: vincent.guittot@linaro.org
Cc: bsegall@google.com, christian.loehle@arm.com,
dietmar.eggemann@arm.com, elif.topuz@arm.com,
juri.lelli@redhat.com, kayracizmeci@gmail.com,
kprateek.nayak@amd.com, linux-kernel@vger.kernel.org,
mgorman@suse.de, mingo@kernel.org, mingo@redhat.com,
peterz@infradead.org, rostedt@goodmis.org, sh@gentwo.org,
vschneid@redhat.com
Subject: Re: [PATCH] sched/eevdf: Fix vprot across reweighting
Date: Mon, 12 Oct 2026 16:59:19 +0300 [thread overview]
Message-ID: <20261012135920.3247-1-kayracizmeci@gmail.com> (raw)
In-Reply-To: <CAKfTPtC_DjYGmnHuV8x9HEoea87pfrpfNWwHT=sGeSP8UOL2Og@mail.gmail.com>
> I don't get why you need to a se->rel_vprot and all these changes . If
> we want to ensure that protection will not be re enabled because of
> rescale, we just need the below
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 5c98d8dfce5d..e83836fe44ef 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4951,12 +4951,15 @@ static void reweight_eevdf(struct cfs_rq
> *cfs_rq, struct sched_entity *se,
> update_load_set(&se->h_load, weight);
>
> if (on_rq) {
> - if (rel_vprot)
> - se->vprot += avruntime;
> se->deadline += avruntime;
> se->rel_deadline = 0;
> se->vruntime = avruntime - se->vlag;
>
> + if (rel_vprot)
> + se->vprot += avruntime;
> + else if (curr)
> + se->vprot = se->vruntime;
> +
> if (!curr)
> __enqueue_entity(cfs_rq, se);
> cfs_rq->h_nr_queued++;
> or the below which is even simpler because vprot, vlag and deadline
> are rescaled with the same ratio but it implies useless div64_long()
> when the protection is already canceled
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 5c98d8dfce5d..5d1b16780b52 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4936,7 +4936,7 @@ static void reweight_eevdf(struct cfs_rq
> *cfs_rq, struct sched_entity *se,
> se->vlag = entity_lag(cfs_rq, se, avruntime);
> se->deadline -= avruntime;
> se->rel_deadline = 1;
> - if (curr && protect_slice(se)) {
> + if (curr) {
> se->vprot -= avruntime;
> rel_vprot = true;
> }
Here:
https://lore.kernel.org/all/20261001164609.244156-1-kayracizmeci@gmail.com/
https://lore.kernel.org/all/e4700a93-ebd5-4c7e-88b5-d606437a13c0@arm.com/
Because on_rq can get false. And alive protection complicates things.
And this diff alone wouldn't work.
IDK what else we could do to fix this both cases cleanly tbh.
But there could be a cleaner way.
Thanks,
Kayra
next prev parent reply other threads:[~2026-10-12 13:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-03 11:46 Kayra Cizmeci
2026-10-11 7:13 ` Christian Loehle
2026-10-11 10:06 ` Kayra Cizmeci
2026-10-12 4:39 ` K Prateek Nayak
2026-10-12 13:40 ` Vincent Guittot
2026-10-12 13:59 ` Kayra Cizmeci [this message]
2026-10-12 14:14 ` Vincent Guittot
2026-10-12 15:01 ` Kayra Cizmeci
2026-10-12 19:00 ` Kayra Cizmeci
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=20261012135920.3247-1-kayracizmeci@gmail.com \
--to=kayracizmeci@gmail.com \
--cc=bsegall@google.com \
--cc=christian.loehle@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=elif.topuz@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sh@gentwo.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
all inboxes | Powered by JetHome®