tree:
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/wip2
head: fb0089110c5e29151c75028add05458ad2bf8a68
commit: fb0089110c5e29151c75028add05458ad2bf8a68 [5/5] sched: Massage set_cpus_allowed
config: x86_64-randconfig-r026-20200916 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
9e3842d60351f986d77dfe0a94f76e4fd895f188)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout fb0089110c5e29151c75028add05458ad2bf8a68
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> kernel/sched/core.c:6058:47: error: use of undeclared identifier
'SCA_CHECK'
retval = __set_cpus_allowed_ptr(p, new_mask,
SCA_CHECK);
^
1 error generated.
#
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue sched/wip2
git checkout fb0089110c5e29151c75028add05458ad2bf8a68
vim +/SCA_CHECK +6058 kernel/sched/core.c
5991
5992 long sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
5993 {
5994 cpumask_var_t cpus_allowed, new_mask;
5995 struct task_struct *p;
5996 int retval;
5997
5998 rcu_read_lock();
5999
6000 p = find_process_by_pid(pid);
6001 if (!p) {
6002 rcu_read_unlock();
6003 return -ESRCH;
6004 }
6005
6006 /* Prevent p going away */
6007 get_task_struct(p);
6008 rcu_read_unlock();
6009
6010 if (p->flags & PF_NO_SETAFFINITY) {
6011 retval = -EINVAL;
6012 goto out_put_task;
6013 }
6014 if (!alloc_cpumask_var(&cpus_allowed, GFP_KERNEL)) {
6015 retval = -ENOMEM;
6016 goto out_put_task;
6017 }
6018 if (!alloc_cpumask_var(&new_mask, GFP_KERNEL)) {
6019 retval = -ENOMEM;
6020 goto out_free_cpus_allowed;
6021 }
6022 retval = -EPERM;
6023 if (!check_same_owner(p)) {
6024 rcu_read_lock();
6025 if (!ns_capable(__task_cred(p)->user_ns, CAP_SYS_NICE)) {
6026 rcu_read_unlock();
6027 goto out_free_new_mask;
6028 }
6029 rcu_read_unlock();
6030 }
6031
6032 retval = security_task_setscheduler(p);
6033 if (retval)
6034 goto out_free_new_mask;
6035
6036
6037 cpuset_cpus_allowed(p, cpus_allowed);
6038 cpumask_and(new_mask, in_mask, cpus_allowed);
6039
6040 /*
6041 * Since bandwidth control happens on root_domain basis,
6042 * if admission test is enabled, we only admit -deadline
6043 * tasks allowed to run on all the CPUs in the task's
6044 * root_domain.
6045 */
6046 #ifdef CONFIG_SMP
6047 if (task_has_dl_policy(p) && dl_bandwidth_enabled()) {
6048 rcu_read_lock();
6049 if (!cpumask_subset(task_rq(p)->rd->span, new_mask)) {
6050 retval = -EBUSY;
6051 rcu_read_unlock();
6052 goto out_free_new_mask;
6053 }
6054 rcu_read_unlock();
6055 }
6056 #endif
6057 again:
6058 retval = __set_cpus_allowed_ptr(p, new_mask, SCA_CHECK);
6059
6060 if (!retval) {
6061 cpuset_cpus_allowed(p, cpus_allowed);
6062 if (!cpumask_subset(new_mask, cpus_allowed)) {
6063 /*
6064 * We must have raced with a concurrent cpuset
6065 * update. Just reset the cpus_allowed to the
6066 * cpuset's cpus_allowed
6067 */
6068 cpumask_copy(new_mask, cpus_allowed);
6069 goto again;
6070 }
6071 }
6072 out_free_new_mask:
6073 free_cpumask_var(new_mask);
6074 out_free_cpus_allowed:
6075 free_cpumask_var(cpus_allowed);
6076 out_put_task:
6077 put_task_struct(p);
6078 return retval;
6079 }
6080
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org