Re: Kaffeine problem with CFS

William Lee Irwin III
2007-04-18T16:07:39Z

On Wed, Apr 18, 2007 at 05:48:11PM +0200, Ingo Molnar wrote:
> static void requeue_task_fair(struct rq *rq, struct task_struct *p)
> {
> dequeue_task_fair(rq, p);
> p->on_rq = 0;
> - enqueue_task_fair(rq, p);
> + /*
> + * Temporarily insert at the last position of the tree:
> + */
> + p->fair_key = LLONG_MAX;
> + __enqueue_task_fair(rq, p);
> p->on_rq = 1;
> +
> + /*
> + * Update the key to the real value, so that when all other
> + * tasks from before the rightmost position have executed,
> + * this task is picked up again:
> + */
> + p->fair_key = rq->fair_clock - p->wait_runtime + p->nice_offset;

At this point you might as well call the requeue operation something
having to do with yield. I also suspect what goes on during the timer
tick may eventually become something different from requeueing the
current task, and furthermore class-dependent.

-- wli