Re: [tip:sched/core] sched/fair: Fix O(nr_cgroups) in load balance path
From: Peter Zijlstra
Date: Mon May 15 2017 - 05:43:18 EST
On Mon, May 15, 2017 at 02:13:17AM -0700, tip-bot for Tejun Heo wrote:
> @@ -463,7 +464,7 @@ static inline void list_del_leaf_cfs_rq(struct cfs_rq *cfs_rq)
> {
> }
>
> -#define for_each_leaf_cfs_rq(rq, cfs_rq) \
> +#define for_each_leaf_cfs_rq_safe(rq, cfs_rq, pos) \
> for (cfs_rq = &rq->cfs; cfs_rq; cfs_rq = NULL)
>
> static inline struct sched_entity *parent_entity(struct sched_entity *se)
That generates a build warn on CGROUP=n SCHED_DEBUG=y
This seems to cure..
Ingo, could you fold or append?
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ca08ae2a7877..219fe58e3023 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -465,7 +465,7 @@ static inline void list_del_leaf_cfs_rq(struct cfs_rq *cfs_rq)
}
#define for_each_leaf_cfs_rq_safe(rq, cfs_rq, pos) \
- for (cfs_rq = &rq->cfs; cfs_rq; cfs_rq = NULL)
+ for (cfs_rq = &rq->cfs, pos = NULL; cfs_rq; cfs_rq = pos)
static inline struct sched_entity *parent_entity(struct sched_entity *se)
{