From what I have understood so far about the Linux CFS is that scheduling entities are indexed by their virtual runtime (vruntime
) inside the RB-tree.
The scheduler regularly updates this vruntime
by calling the update_curr
function which basically increase the vruntime value of the current running entity.
What I don't understand is how does the scheduler keeps the RB-tree always well ordered. The update_curr
function increases the value of vruntime
but does not seem to check whether the entity should be moved back into the right of RB-tree. Which function performs this check?