tree:
https://github.com/zen-kernel/zen-kernel 5.14/prjc
head: d549588e3d79002f0c4b567b49644318af78a3db
commit: f39855f79e9734c35dc7c4fac4c68ad7ab895ea3 [115/209] sched/alt: Implement fake
cpu.shares for CGROUP
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
#
https://github.com/zen-kernel/zen-kernel/commit/f39855f79e9734c35dc7c4fac...
git remote add zen-kernel-zen-kernel
https://github.com/zen-kernel/zen-kernel
git fetch --no-tags zen-kernel-zen-kernel 5.14/prjc
git checkout f39855f79e9734c35dc7c4fac4c68ad7ab895ea3
# save the attached .config to linux build tree
make W=1 ARCH=um SUBARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
kernel/sched/alt_core.c:4005:21: error: 'struct task_struct' has no member
named 'state'; did you mean '__state'?
4005 | prev_state = prev->state;
| ^~~~~
| __state
kernel/sched/alt_core.c:4006:52: error: 'struct task_struct' has no member
named 'state'; did you mean '__state'?
4006 | if (!preempt && prev_state && prev_state == prev->state) {
| ^~~~~
| __state
kernel/sched/alt_core.c:4008:10: error: 'struct task_struct' has no member
named 'state'; did you mean '__state'?
4008 | prev->state = TASK_RUNNING;
| ^~~~~
| __state
kernel/sched/alt_core.c: In function 'sched_submit_work':
kernel/sched/alt_core.c:4109:12: error: 'struct task_struct' has no member
named 'state'; did you mean '__state'?
4109 | if (!tsk->state)
| ^~~~~
| __state
In file included from include/asm-generic/bug.h:7,
from ./arch/um/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/thread_info.h:13,
from include/asm-generic/current.h:5,
from ./arch/um/include/generated/asm/current.h:1,
from include/linux/sched.h:12,
from include/linux/kthread.h:6,
from include/trace/events/sched.h:8,
from kernel/sched/alt_core.c:15:
kernel/sched/alt_core.c: In function 'schedule_idle':
kernel/sched/alt_core.c:4184:24: error: 'struct task_struct' has no member
named 'state'; did you mean '__state'?
4184 | WARN_ON_ONCE(current->state);
| ^~~~~
include/linux/once_lite.h:15:27: note: in definition of macro
'DO_ONCE_LITE_IF'
15 | bool __ret_do_once = !!(condition); \
| ^~~~~~~~~
kernel/sched/alt_core.c:4184:2: note: in expansion of macro 'WARN_ON_ONCE'
4184 | WARN_ON_ONCE(current->state);
| ^~~~~~~~~~~~
kernel/sched/alt_core.c: In function '__sched_setscheduler':
kernel/sched/alt_core.c:4713:39: error: 'MAX_USER_RT_PRIO' undeclared (first
use in this function); did you mean 'MAX_RT_PRIO'?
4713 | (p->mm && attr->sched_priority > MAX_USER_RT_PRIO - 1)
||
| ^~~~~~~~~~~~~~~~
| MAX_RT_PRIO
kernel/sched/alt_core.c:4713:39: note: each undeclared identifier is reported only once
for each function it appears in
kernel/sched/alt_core.c: At top level:
kernel/sched/alt_core.c:5473:13: error: redefinition of '_cond_resched'
5473 | int __sched _cond_resched(void)
| ^~~~~~~~~~~~~
In file included from include/linux/kthread.h:6,
from include/trace/events/sched.h:8,
from kernel/sched/alt_core.c:15:
include/linux/sched.h:1957:19: note: previous definition of '_cond_resched' was
here
1957 | static inline int _cond_resched(void)
| ^~~~~~~~~~~~~
kernel/sched/alt_core.c: In function '__do_sys_sched_get_priority_max':
kernel/sched/alt_core.c:5626:9: error: 'MAX_USER_RT_PRIO' undeclared (first use
in this function); did you mean 'MAX_RT_PRIO'?
5626 | ret = MAX_USER_RT_PRIO-1;
| ^~~~~~~~~~~~~~~~
| MAX_RT_PRIO
kernel/sched/alt_core.c: In function 'sched_show_task':
kernel/sched/alt_core.c:5736:9: error: 'struct task_struct' has no member named
'state'; did you mean '__state'?
5736 | if (p->state == TASK_RUNNING)
| ^~~~~
| __state
kernel/sched/alt_core.c: In function 'state_filter_match':
kernel/sched/alt_core.c:5765:11: error: 'struct task_struct' has no member
named 'state'; did you mean '__state'?
5765 | if (!(p->state & state_filter))
| ^~~~~
| __state
kernel/sched/alt_core.c:5772:49: error: 'struct task_struct' has no member
named 'state'; did you mean '__state'?
5772 | if (state_filter == TASK_UNINTERRUPTIBLE && p->state == TASK_IDLE)
| ^~~~~
| __state
kernel/sched/alt_core.c: At top level:
kernel/sched/alt_core.c:5779:6: error: conflicting types for
'show_state_filter'
5779 | void show_state_filter(unsigned long state_filter)
| ^~~~~~~~~~~~~~~~~
In file included from kernel/sched/alt_sched.h:9,
from kernel/sched/sched.h:6,
from kernel/sched/alt_core.c:18:
include/linux/sched/debug.h:17:13: note: previous declaration of
'show_state_filter' was here
17 | extern void show_state_filter(unsigned int state_filter);
| ^~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c: In function 'init_idle':
kernel/sched/alt_core.c:5838:8: error: 'struct task_struct' has no member named
'state'; did you mean '__state'?
5838 | idle->state = TASK_RUNNING;
| ^~~~~
| __state
kernel/sched/alt_core.c: At top level:
kernel/sched/alt_core.c:6740:20: warning: no previous prototype for
'sched_create_group' [-Wmissing-prototypes]
6740 | struct task_group *sched_create_group(struct task_group *parent)
| ^~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6751:6: warning: no previous prototype for
'sched_online_group' [-Wmissing-prototypes]
6751 | void sched_online_group(struct task_group *tg, struct task_group *parent)
| ^~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6762:6: warning: no previous prototype for
'sched_destroy_group' [-Wmissing-prototypes]
6762 | void sched_destroy_group(struct task_group *tg)
| ^~~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6768:6: warning: no previous prototype for
'sched_offline_group' [-Wmissing-prototypes]
6768 | void sched_offline_group(struct task_group *tg)
| ^~~~~~~~~~~~~~~~~~~
> kernel/sched/alt_core.c:6838:5: warning: no previous prototype
for 'sched_group_set_shares' [-Wmissing-prototypes]
6838 | int
sched_group_set_shares(struct task_group *tg, unsigned long shares)
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6907:20: warning: initialized field overwritten
[-Woverride-init]
6907 | .legacy_cftypes = cpu_legacy_files,
| ^~~~~~~~~~~~~~~~
kernel/sched/alt_core.c:6907:20: note: (near initialization for
'cpu_cgrp_subsys.legacy_cftypes')
cc1: some warnings being treated as errors
vim +/sched_group_set_shares +6838 kernel/sched/alt_core.c
6750
6751 void sched_online_group(struct task_group *tg, struct task_group
*parent)
6752 {
6753 }
6754
6755 /* rcu callback to free various structures associated with a task group */
6756 static void sched_free_group_rcu(struct rcu_head *rhp)
6757 {
6758 /* Now it should be safe to free those cfs_rqs */
6759 sched_free_group(container_of(rhp, struct task_group, rcu));
6760 }
6761
6762 void sched_destroy_group(struct task_group *tg)
6763 {
6764 /* Wait for possible concurrent references to cfs_rqs complete */
6765 call_rcu(&tg->rcu, sched_free_group_rcu);
6766 }
6767
6768 void sched_offline_group(struct task_group *tg)
6769 {
6770 }
6771
6772 static inline struct task_group *css_tg(struct cgroup_subsys_state *css)
6773 {
6774 return css ? container_of(css, struct task_group, css) : NULL;
6775 }
6776
6777 static struct cgroup_subsys_state *
6778 cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
6779 {
6780 struct task_group *parent = css_tg(parent_css);
6781 struct task_group *tg;
6782
6783 if (!parent) {
6784 /* This is early initialization for the top cgroup */
6785 return &root_task_group.css;
6786 }
6787
6788 tg = sched_create_group(parent);
6789 if (IS_ERR(tg))
6790 return ERR_PTR(-ENOMEM);
6791 return &tg->css;
6792 }
6793
6794 /* Expose task group only after completing cgroup initialization */
6795 static int cpu_cgroup_css_online(struct cgroup_subsys_state *css)
6796 {
6797 struct task_group *tg = css_tg(css);
6798 struct task_group *parent = css_tg(css->parent);
6799
6800 if (parent)
6801 sched_online_group(tg, parent);
6802 return 0;
6803 }
6804
6805 static void cpu_cgroup_css_released(struct cgroup_subsys_state *css)
6806 {
6807 struct task_group *tg = css_tg(css);
6808
6809 sched_offline_group(tg);
6810 }
6811
6812 static void cpu_cgroup_css_free(struct cgroup_subsys_state *css)
6813 {
6814 struct task_group *tg = css_tg(css);
6815
6816 /*
6817 * Relies on the RCU grace period between css_released() and this.
6818 */
6819 sched_free_group(tg);
6820 }
6821
6822 static void cpu_cgroup_fork(struct task_struct *task)
6823 {
6824 }
6825
6826 static int cpu_cgroup_can_attach(struct cgroup_taskset *tset)
6827 {
6828 return 0;
6829 }
6830
6831 static void cpu_cgroup_attach(struct cgroup_taskset *tset)
6832 {
6833 }
6834
6835 #ifdef CONFIG_FAIR_GROUP_SCHED
6836 static DEFINE_MUTEX(shares_mutex);
6837
6838 int sched_group_set_shares(struct task_group *tg, unsigned long
shares)
6839 {
6840 /*
6841 * We can't change the weight of the root cgroup.
6842 */
6843 if (&root_task_group == tg)
6844 return -EINVAL;
6845
6846 shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES));
6847
6848 mutex_lock(&shares_mutex);
6849 if (tg->shares == shares)
6850 goto done;
6851
6852 tg->shares = shares;
6853 done:
6854 mutex_unlock(&shares_mutex);
6855 return 0;
6856 }
6857
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org