From: Honglei Wang <jameshongleiwang@126.com>
To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
vschneid@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] sched/stats: correct the wait_start calculation logic
Date: Thu, 13 Nov 2025 20:43:26 +0800 [thread overview]
Message-ID: <20251113124326.27588-1-jameshongleiwang@126.com> (raw)
It's not necessary to do the delta-related subtraction if the task
is not on rq migrating. Add the migrating related judgment back.
Signed-off-by: Honglei Wang <jameshongleiwang@126.com>
---
kernel/sched/stats.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c
index d1c9429a4ac5..60560fb31e63 100644
--- a/kernel/sched/stats.c
+++ b/kernel/sched/stats.c
@@ -12,7 +12,8 @@ void __update_stats_wait_start(struct rq *rq, struct task_struct *p,
wait_start = rq_clock(rq);
prev_wait_start = schedstat_val(stats->wait_start);
- if (p && likely(wait_start > prev_wait_start))
+ if (p && task_on_rq_migrating(p) &&
+ likely(wait_start > prev_wait_start))
wait_start -= prev_wait_start;
__schedstat_set(stats->wait_start, wait_start);
--
2.33.0
next reply other threads:[~2025-11-13 12:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 12:43 Honglei Wang [this message]
2025-11-26 2:01 ` Honglei Wang
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=20251113124326.27588-1-jameshongleiwang@126.com \
--to=jameshongleiwang@126.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=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®