[LTP] [PATCH v2] sched_football: synchronize with kickoff flag to reduce skew

Cyril Hrubis chrubis@suse.cz
Fri Sep 5 11:18:46 CEST 2025


Hi!
> Checking the configurations of the stock kernel and the real-time
> kernel, the stock kernel uses "CONFIG_PREEMPT_VOLUNTARY=y,"
> which only provides voluntary preemption.
>
> This preemption model is designed to strike a balance between throughput
> and latency. It only allows the kernel to be preempted at specific, well
> defined
> "safe points," potentially resulting in long, unbounded latencies.
> 
> However, the sched_football test was most likely designed to measure or
> stress-test the deterministic, low-latency scheduling behavior that is
> characteristic of real-time (RT) kernel.
> 
> So, I tend to believe the test's failure on the stock kernel is acceptable.

I still find it a bit unexpected though. The preeption models apply only
to kernel code. The user space code can be stil preempted at any point,
so the offense threads should be preempted and replaced by high priority
tasks and never executed again since we do not call to the kernel there
at all, we just run a loop that increments an integer there. I guess
that one possibility is that we saturate the machine with real-time
tasks to the extend that scheduller code in kernel does not get to
distribute the processes. If that is a problem we need to give kernel
chance to shuffle the processes when we wait for the kickoff flag.

Does things start to work if we change the loops that wait for the final
kickoff to:

       while (!tst_atomic_load(&kickoff_flag))
               sched_yield();

This should trigger the scheduller code to be executed so that it has
chance to distribute the processes around.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list