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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <vatsa@...>
Cc: Andrew Morton <akpm@...>, <ckrm-tech@...>, <linux-kernel@...>, <containers@...>, Jan Engelhardt <jengelh@...>, Ingo Molnar <mingo@...>, <dhaval@...>, <menage@...>
Date: Tuesday, September 11, 2007 - 5:53 am

On 11/09/2007, Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> wrote:

I guess, 'rq->curr == tsk' implies a task was on the 'rq' (before
dequeueing) in this particular case. What's about a minor optimization
like below (plus, let's make use of task_running()):

[ btw., real-time task can be also added to a container, right? I
guess, it can be used at least for group-aware load-balancing of
rt_tasks... otherwise, I guess, cpu-resource controlling is not that
applicable to, say, SCHED_FIFO :-)
Anyway, to this goal rt_task should become aware of group-related bits
of the 'struct sched_entity'... and at the moment, the code below is
effectively just a 'nop' for them.. right? ]

/* 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, running;
       unsigned long flags;
       struct rq *rq;

       rq = task_rq_lock(tsk, &flags);
       update_rq_clock(rq);

       running = task_running(rq, tsk);
       on_rq = tsk->se.on_rq;
       if (on_rq) {
               dequeue_task(rq, tsk, 0);

               if (unlikely(running) && tsk->sched_class == &fair_sched_class)
                      tsk->sched_class->put_prev_task(rq, tsk);
       }

       set_task_cfs_rq(tsk);

       if (on_rq) {
                enqueue_task(rq, tsk, 0);

                if (unlikely(running) && tsk->sched_class == &fair_sched_class)
                       tsk->sched_class->set_curr_task(rq);
       }

       task_rq_unlock(rq, &flags);
}



-- 
Best regards,
Dmitry Adamushko
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Hookup group-scheduler with task container infrastru..., Srivatsa Vaddagiri, (Mon Sep 10, 1:10 pm)
Re: [PATCH] Hookup group-scheduler with task container infra..., KAMEZAWA Hiroyuki, (Tue Sep 18, 4:19 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Tue Sep 18, 6:44 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Mon Sep 10, 1:23 pm)
Re: [Devel] Re: [PATCH] Hookup group-scheduler with task con..., Srivatsa Vaddagiri, (Tue Sep 11, 12:44 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Mon Sep 10, 1:46 pm)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Tue Sep 11, 11:51 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Tue Sep 11, 12:41 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Dmitry Adamushko, (Tue Sep 11, 5:53 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Wed Sep 12, 7:42 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Dmitry Adamushko, (Wed Sep 12, 12:25 pm)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Thu Sep 13, 8:33 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Fri Sep 14, 11:59 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Fri Sep 14, 12:22 pm)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Wed Sep 12, 8:10 am)
Re: [PATCH] Hookup group-scheduler with task container infra..., Srivatsa Vaddagiri, (Mon Sep 10, 1:28 pm)