Re: [PATCH] Hookup group-scheduler with task container infrastructure

From: Dmitry Adamushko
Date: Mon Sep 10 2007 - 18:29:04 EST


On 10/09/2007, Srivatsa Vaddagiri <vatsa@xxxxxxxxxxxxxxxxxx> wrote:
> On Mon, Sep 10, 2007 at 10:22:59AM -0700, Andrew Morton wrote:
> > objection ;) "cpuctlr" isn't memorable. Kernel code is write-rarely,
> > read-often. "cpu_controller", please. The extra typing is worth it ;)
>
> Ok! Here's the modified patch (against 2.6.23-rc4-mm1).
>
> [ ... ]
>
> +/* change task's runqueue when it moves between groups */
> +static void sched_move_task(struct container_subsys *ss, struct container *cont,
> + struct container *old_cont, struct task_struct *tsk)
> +{
> + int on_rq;
> + unsigned long flags;
> + struct rq *rq;
> +
> + rq = task_rq_lock(tsk, &flags);
> +

I guess, update_rq_clock(rq) should be placed here.

humm... do you really need deactivate/activate_task() here? 'rq' and
p->se.load.weight stay unchanged so enqueue/dequeue_task() would do a
job, no?
Although, I might be missing (definitely, as this part is not
completely clear to me yet) something important at this late hour :)


> + on_rq = tsk->se.on_rq;
> + if (on_rq)
> + deactivate_task(rq, tsk, 0);
> +
> + if (unlikely(rq->curr == tsk) && tsk->sched_class == &fair_sched_class)
> + tsk->sched_class->put_prev_task(rq, tsk);
> +
> + set_task_cfs_rq(tsk);
> +
> + if (on_rq)
> + activate_task(rq, tsk, 0);
> +
> + if (unlikely(rq->curr == tsk) && tsk->sched_class == &fair_sched_class)
> + tsk->sched_class->set_curr_task(rq);
> +
> + task_rq_unlock(rq, &flags);
> +}
> +


--
Best regards,
Dmitry Adamushko
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/