From: David Carlier <devnexen@gmail.com>
To: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
Andrea Righi <arighi@nvidia.com>
Cc: linux-kernel@vger.kernel.org, David Carlier <devnexen@gmail.com>
Subject: [PATCH] tools/sched_ext/scx_userland: fix stale data on restart.
Date: Sat, 14 Feb 2026 08:00:33 +0000 [thread overview]
Message-ID: <20260214080033.20240-1-devnexen@gmail.com> (raw)
we reset all counters, tasks and vruntime_head list.
Signed-off-by: David Carlier <devnexen@gmail.com>
---
tools/sched_ext/scx_userland.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/sched_ext/scx_userland.c b/tools/sched_ext/scx_userland.c
index 63f89b35d999..504a80824f5c 100644
--- a/tools/sched_ext/scx_userland.c
+++ b/tools/sched_ext/scx_userland.c
@@ -375,6 +375,14 @@ static void pre_bootstrap(int argc, char **argv)
static void bootstrap(char *comm)
{
exit_req = 0;
+ min_vruntime = 0.0;
+ nr_vruntime_enqueues = 0;
+ nr_vruntime_dispatches = 0;
+ nr_vruntime_failed = 0;
+ nr_curr_enqueued = 0;
+ memset(tasks, 0, pid_max * sizeof(*tasks));
+ LIST_INIT(&vruntime_head);
+
skel = SCX_OPS_OPEN(userland_ops, scx_userland);
skel->rodata->num_possible_cpus = libbpf_num_possible_cpus();
--
2.51.0
next reply other threads:[~2026-02-14 8:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-14 8:00 David Carlier [this message]
2026-02-17 7:04 ` [PATCH] tools/sched_ext/scx_userland: fix stale data on restart Tejun Heo
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=20260214080033.20240-1-devnexen@gmail.com \
--to=devnexen@gmail.com \
--cc=arighi@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=void@manifault.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