Re: [PATCH v3 2/2] sched: Handle on_list ancestor in list_add_leaf_cfs_rq()

Peter Zijlstra
2011-08-23T18:57:04Z

On Tue, 2011-08-23 at 20:53 +0200, Peter Zijlstra wrote:
> LIST_HEAD(leaf_queue);
>
> for_each_sched_entity(se) {
> if (se->on_rq)
> break;
> cfs_rq = cfs_rq_of(se);
> enqueue_entity(cfs_rq, se, flags);
> flags = ENQUEUE_WAKEUP;
> if (cfs_rq->nr_running == 1)
> leaf_add_queue(cfs_rq, &leaf_queue);
> }
> /* XXX does ->on_rq imply ->on_list ? */
> if (se->on_list)
> leaf_splice_queue(cfs_rq, &leaf_queue);

Bah, se can be NULL here, still needing some extra foo.