lkml.org 
[lkml]   [2011]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 05/18] sched: Provide p->on_rq
On 01/04/11 06:59, 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 +++++-----
> kernel/sched_stoptask.c | 2 +-
> 5 files changed, 26 insertions(+), 25 deletions(-)

> ===================================================================
> --- linux-2.6.orig/kernel/sched.c
> +++ linux-2.6/kernel/sched.c


> @@ -2571,18 +2570,20 @@ int wake_up_state(struct task_struct *p,
> */
> static void __sched_fork(struct task_struct *p)
> {
> + p->on_rq = 0;

Nitpick: column alignment of "= 0" ^^^^.


> +
> + p->se.on_rq = 0;
> p->se.exec_start = 0;
> p->se.sum_exec_runtime = 0;
> p->se.prev_sum_exec_runtime = 0;
> p->se.nr_migrations = 0;
> + INIT_LIST_HEAD(&p->se.group_node);
>
> #ifdef CONFIG_SCHEDSTATS
> memset(&p->se.statistics, 0, sizeof(p->se.statistics));
> #endif
>
> INIT_LIST_HEAD(&p->rt.run_list);
> - p->se.on_rq = 0;
> - INIT_LIST_HEAD(&p->se.group_node);
>
> #ifdef CONFIG_PREEMPT_NOTIFIERS
> INIT_HLIST_HEAD(&p->preempt_notifiers);
>


-Frank



\
 
 \ /
  Last update: 2011-01-29 01:13    [W:0.165 / U:2.868 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site