On 10/13/22 00:07, Christophe Blaess wrote:
Hi
On 13/10/2022 01:25, Sebastian Kuzminsky wrote:
Thanks for the suggestion, but it gives results that are only slightly
better:
It will probably make no difference as you run your task on an isolcpu
but did you set `sysctl kernel.sched_rt_runtime_us=-1`
Wow, this plus Clark's suggestion to run with SCHED_FIFO priority 2
fixed it, thank you!!
With those two changes I now get identical, awesome results with
SCHED_OTHER:0 and SCHED_FIFO:2 (running on an isolcpu):
$ sudo sysctl kernel.sched_rt_runtime_us=-1
kernel.sched_rt_runtime_us = -1
$ sudo ./busy
using PTHREAD_EXPLICT_SCHED to set SCHED_FIFO (with highest priority)
scheduling policy: SCHED_FIFO
scheduling parameter priority: 2 (min=1, max=99)
cpu affinity: 3
after 10000 iterations:
min=54001 cycles (1000.019 us, 1.000 ms)
avg=54002.001 cycles (1000.037 us, 1.000 ms)
max=54004 cycles (1000.074 us, 1.000 ms)
OK: worst latency < 2 ms
using PTHREAD_INHERIT_SCHED to keep SCHED_OTHER (with default priority)
scheduling policy: SCHED_OTHER
scheduling parameter priority: 0 (min=0, max=0)
cpu affinity: 3
after 10000 iterations:
min=54001 cycles (1000.019 us, 1.000 ms)
avg=54002.001 cycles (1000.037 us, 1.000 ms)
max=54004 cycles (1000.074 us, 1.000 ms)
OK: worst latency < 2 ms
Thank you Christophe and Clark!
--
Sebastian Kuzminsky