lkml.org 
[lkml]   [2010]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 06/17] sched: Provide p->on_rq
On Fri, Dec 24, 2010 at 01:23:44PM +0100, Peter Zijlstra wrote:
> Provide a generic p->on_rq because the p->se.on_rq semantics are
> unfavourable for lockless wakeups but needed for sched_fair.
>
> In particular, p->on_rq is only cleared when we actually dequeue the
> task in schedule() and not on any random dequeue as done by things
> like __migrate_task() and __sched_setscheduler().
>
> This also allows us to remove p->se usage from !sched_fair code.
>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> include/linux/sched.h | 1 +
> kernel/sched.c | 36 ++++++++++++++++++------------------
> kernel/sched_debug.c | 2 +-
> kernel/sched_rt.c | 10 +++++-----
> Index: linux-2.6/kernel/sched_rt.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched_rt.c
> +++ linux-2.6/kernel/sched_rt.c
> @@ -1132,7 +1132,7 @@ static void put_prev_task_rt(struct rq *
> * The previous task needs to be made eligible for pushing
> * if it is still active
> */
> - if (p->se.on_rq && p->rt.nr_cpus_allowed > 1)
> + if (p->on_rq && p->rt.nr_cpus_allowed > 1)
> enqueue_pushable_task(rq, p);

Seems we need on_rt_rq(&p->rt) here, otherwise we enqueue the
task to pushable list when called from rt_mutex_setprio()/
__sched_setscheduler() etc. Thus add a little overhead.
Though we call dequeue_pushable_task() in set_curr_task_rt()
unconditionally.

Thanks,
Yong


\
 
 \ /
  Last update: 2010-12-29 15:17    [W:0.253 / U:1.760 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site