]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
tools/sched_ext: scx_userland: fix stale data on restart
authorDavid Carlier <devnexen@gmail.com>
Sat, 14 Feb 2026 08:00:33 +0000 (08:00 +0000)
committerTejun Heo <tj@kernel.org>
Tue, 17 Feb 2026 07:02:16 +0000 (21:02 -1000)
Reset all counters, tasks and vruntime_head list on restart.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/scx_userland.c

index 63f89b35d9992f7dd0becea3af8352875d7f6ac8..504a80824f5c502a8c267e39fd520d4d9f5145a7 100644 (file)
@@ -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();