Issue
#define for_each_sched_rt_entity(rt_se) \
for (; rt_se; rt_se = NULL)
I'm not familiar with what this for loop is actually doing. Would anyone be able to explain?
https://elixir.bootlin.com/linux/v5.10.75/source/kernel/sched/rt.c#L621
Solution
This macro is setting rt_se to NULL after the instructions block that follows has been executed. The use of such "access" macro is common in the kernel to make the code more clear and robust.
Answered By - Eric Marchand