I would highly suggest you explore the wonders of cscope and/or grok. Where you can type in or click on an identifier and see the definition.
This is classic linux code: compact, to the point and pretty readable. The use of some macros makes it a little harder to understand, but everything has meaningful names.
For the part where you said 'nothing makes sense': for_each_sched_rt_entity
is a macro that expands to a for loop.
It makes the code more compact but harder to understand.
Basically, if any of the rq's in our task have run out of run time
then the task is tossed back to the scheduler to set it up to run
again some other time.
Easy peasy.