On Thu, 2010-12-02 at 14:44 -0500, Rik van Riel wrote:
That "slice remaining" only shows the distance to last preempt, however
brief. It shows nothing wrt tree position, the yielding task may well
already be right of the task it wants to yield to, having been a buddy.
(This is usually done using max_vruntime())
If the recipient was already left of the fair stick (min_vruntime),
clipping advances it's vruntime, vaporizing entitlement from both donor
and recipient.
What if a task tries to yield to another not on the same cpu, and/or in
the same task group? This would munge min_vruntime of other queues. I
think you'd have to restrict this to same cpu, same group. If tasks can
donate cross cfs_rq, (say) pinned task A cpu A running solo could donate
vruntime to selected tasks pinned to cpu B, for as long as minuscule
preemptions can resupply ammo. Would suck to not be the favored child.
Maybe you could exchange vruntimes cooperatively (iff same cfs_rq)
between threads, but I don't think donations with clipping works.
-Mike
--