From: Wang Tao <wangtao554@huawei.com>
To: <mingo@redhat.com>, <peterz@infradead.org>,
<juri.lelli@redhat.com>, <vincent.guittot@linaro.org>
Cc: <dietmar.eggemann@arm.com>, <rostedt@goodmis.org>,
<bsegall@google.com>, <mgorman@suse.de>, <vschneid@redhat.com>,
<tanghui20@huawei.com>, <zhangqiao22@huawei.com>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] sched/eevdf: Update se->vprot in reweight_entity()
Date: Tue, 20 Jan 2026 12:31:13 +0000 [thread overview]
Message-ID: <20260120123113.3518950-1-wangtao554@huawei.com> (raw)
In the EEVDF framework with Run-to-Parity protection, `se->vprot` is an
independent variable defining the virtual protection timestamp.
When `reweight_entity()` is called (e.g., via nice/renice), it performs
the following actions to preserve Lag consistency:
1. Scales `se->vlag` based on the new weight.
2. Calls `place_entity()`, which recalculates `se->vruntime` based on
the new weight and scaled lag.
However, the current implementation fails to update `se->vprot`, leading
to mismatches between the task's actual runtime and its expected duration.
This patch fixes the issue by calling `set_protect_slice()` at the end of
`reweight_entity()`. This ensures that a new, valid protection slice is
committed based on the updated `vruntime` and the new weight, restoring
Run-to-Parity consistency immediately after a weight change.
Fixes: 63304558ba5d ("sched/eevdf: Curb wakeup-preemption")
Suggested-by: Zhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: Wang Tao <wangtao554@huawei.com>
---
kernel/sched/fair.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e71302282671..bdd8c4e688ae 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3792,6 +3792,8 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
if (!curr)
__enqueue_entity(cfs_rq, se);
cfs_rq->nr_queued++;
+ if (curr)
+ set_protect_slice(cfs_rq, se);
}
}
--
2.34.1
next reply other threads:[~2026-01-20 12:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 12:31 Wang Tao [this message]
2026-01-21 4:21 ` K Prateek Nayak
2026-01-21 9:33 ` wangtao (EQ)
2026-01-21 17:00 ` Vincent Guittot
2026-01-22 4:38 ` K Prateek Nayak
2026-01-23 16:38 ` Vincent Guittot
2026-01-22 7:52 ` wangtao (EQ)
2026-01-23 17:32 ` Vincent Guittot
2026-01-23 15:38 ` Peter Zijlstra
2026-01-23 16:39 ` K Prateek Nayak
2026-01-23 21:31 ` Peter Zijlstra
2026-01-23 17:37 ` Vincent Guittot
2026-02-23 10:25 ` [tip: sched/urgent] " tip-bot2 for Wang Tao
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=20260120123113.3518950-1-wangtao554@huawei.com \
--to=wangtao554@huawei.com \
--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=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tanghui20@huawei.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=zhangqiao22@huawei.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®