Skip to content

Commit 0767684

Browse files
devnexenhtejun
authored andcommitted
tools/sched_ext: scx_userland: fix stale data on restart
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>
1 parent cabd76b commit 0767684

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tools/sched_ext/scx_userland.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,14 @@ static void pre_bootstrap(int argc, char **argv)
375375
static void bootstrap(char *comm)
376376
{
377377
exit_req = 0;
378+
min_vruntime = 0.0;
379+
nr_vruntime_enqueues = 0;
380+
nr_vruntime_dispatches = 0;
381+
nr_vruntime_failed = 0;
382+
nr_curr_enqueued = 0;
383+
memset(tasks, 0, pid_max * sizeof(*tasks));
384+
LIST_INIT(&vruntime_head);
385+
378386
skel = SCX_OPS_OPEN(userland_ops, scx_userland);
379387

380388
skel->rodata->num_possible_cpus = libbpf_num_possible_cpus();

0 commit comments

Comments
 (0)