File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -793,14 +793,18 @@ static inline struct task_group *task_group(struct task_struct *p)
793
793
/* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
794
794
static inline void set_task_rq (struct task_struct * p , unsigned int cpu )
795
795
{
796
+ #if defined(CONFIG_FAIR_GROUP_SCHED ) || defined(CONFIG_RT_GROUP_SCHED )
797
+ struct task_group * tg = task_group (p );
798
+ #endif
799
+
796
800
#ifdef CONFIG_FAIR_GROUP_SCHED
797
- p -> se .cfs_rq = task_group ( p ) -> cfs_rq [cpu ];
798
- p -> se .parent = task_group ( p ) -> se [cpu ];
801
+ p -> se .cfs_rq = tg -> cfs_rq [cpu ];
802
+ p -> se .parent = tg -> se [cpu ];
799
803
#endif
800
804
801
805
#ifdef CONFIG_RT_GROUP_SCHED
802
- p -> rt .rt_rq = task_group ( p ) -> rt_rq [cpu ];
803
- p -> rt .parent = task_group ( p ) -> rt_se [cpu ];
806
+ p -> rt .rt_rq = tg -> rt_rq [cpu ];
807
+ p -> rt .parent = tg -> rt_se [cpu ];
804
808
#endif
805
809
}
806
810
You can’t perform that action at this time.
0 commit comments