]> www.infradead.org Git - users/hch/misc.git/commitdiff
sched: Put task_group::idle under CONFIG_GROUP_SCHED_WEIGHT
authorYu Liao <liaoyu15@huawei.com>
Mon, 23 Sep 2024 13:54:31 +0000 (21:54 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 23 Sep 2024 15:24:12 +0000 (05:24 -1000)
When build with CONFIG_GROUP_SCHED_WEIGHT && !CONFIG_FAIR_GROUP_SCHED,
the idle member is not defined:

kernel/sched/ext.c:3701:16: error: 'struct task_group' has no member named 'idle'
  3701 |         if (!tg->idle)
       |                ^~

Fix this by putting 'idle' under new CONFIG_GROUP_SCHED_WEIGHT.

tj: Move idle field upward to avoid breaking up CONFIG_FAIR_GROUP_SCHED block.

Fixes: e179e80c5d4f ("sched: Introduce CONFIG_GROUP_SCHED_WEIGHT")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409220859.UiCAoFOW-lkp@intel.com/
Signed-off-by: Yu Liao <liaoyu15@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/sched.h

index 91d14061fdca8cd959962736a1b613e51a69369b..b1c3588a8f0039ca260f237b5c1967e3a5d6710b 100644 (file)
@@ -432,16 +432,17 @@ struct cfs_bandwidth {
 struct task_group {
        struct cgroup_subsys_state css;
 
+#ifdef CONFIG_GROUP_SCHED_WEIGHT
+       /* A positive value indicates that this is a SCHED_IDLE group. */
+       int                     idle;
+#endif
+
 #ifdef CONFIG_FAIR_GROUP_SCHED
        /* schedulable entities of this group on each CPU */
        struct sched_entity     **se;
        /* runqueue "owned" by this group on each CPU */
        struct cfs_rq           **cfs_rq;
        unsigned long           shares;
-
-       /* A positive value indicates that this is a SCHED_IDLE group. */
-       int                     idle;
-
 #ifdef CONFIG_SMP
        /*
         * load_avg can be heavily contended at clock tick time, so put