[Devel] [PATCH rh7 2/2] sched/fair: Optimize is_top_cfs_rq()

Vladimir Davydov vdavydov at parallels.com
Wed Sep 23 08:00:31 PDT 2015


On Tue, Sep 22, 2015 at 05:33:11PM +0300, Kirill Tkhai wrote:
...
> @@ -267,10 +267,9 @@ static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp)
>  
>  static inline bool is_top_cfs_rq(struct cfs_rq *cfs_rq)
>  {
> -	struct sched_entity *se;
> +	struct task_group *tg = cfs_rq->tg;
>  
> -	se = cfs_rq->tg->se[cpu_of(rq_of(cfs_rq))];
> -	return se && !se->parent;
> +	return tg != &root_task_group && tg->parent == &root_task_group;

nit: root_task_group.parent == NULL so we could omit
tg != &root_task_group check.

>  }
>  
>  static inline struct cfs_rq *top_cfs_rq_of(struct sched_entity *se)
> 



More information about the Devel mailing list