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: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
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
git checkout fb0089110c5e29151c75028add05458ad2bf8a68
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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:1908:7: error: expected ';',
',' or ')' before 'u32'
1908 | u32 flags)
| ^~~
kernel/sched/core.c: In function 'set_cpus_allowed_ptr':
> kernel/sched/core.c:1986:9: error: implicit declaration of
function '__set_cpus_allowed_ptr'; did you mean 'set_cpus_allowed_ptr'?
[-Werror=implicit-function-declaration]
1986 | return __set_cpus_allowed_ptr(p,
new_mask, 0);
| ^~~~~~~~~~~~~~~~~~~~~~
| set_cpus_allowed_ptr
kernel/sched/core.c: At top level:
kernel/sched/core.c:2412:6: warning: no previous prototype for
'sched_set_stop_task' [-Wmissing-prototypes]
2412 | void sched_set_stop_task(int cpu, struct task_struct *stop)
| ^~~~~~~~~~~~~~~~~~~
kernel/sched/core.c: In function 'schedule_tail':
kernel/sched/core.c:3798:13: warning: variable 'rq' set but not used
[-Wunused-but-set-variable]
3798 | struct rq *rq;
| ^~
kernel/sched/core.c: In function 'init_idle':
> kernel/sched/core.c:6641:2: error: too few arguments to function
'set_cpus_allowed_common'
6641 | set_cpus_allowed_common(idle,
cpumask_of(cpu));
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c:1831:6: note: declared here
1831 | void set_cpus_allowed_common(struct task_struct *p, const struct cpumask
*new_mask, u32 flags)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/core.c: In function '__balance_push_cpu_stop':
kernel/sched/core.c:6802:2: error: implicit declaration of function
'update_rq_clockrq'; did you mean 'update_rq_clock'?
[-Werror=implicit-function-declaration]
6802 | update_rq_clockrq();
| ^~~~~~~~~~~~~~~~~
| update_rq_clock
cc1: some warnings being treated as errors
#
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 +1908 kernel/sched/core.c
1896
1897 /*
1898 * Change a given task's CPU affinity. Migrate the thread to a
1899 * proper CPU and schedule it away if the CPU it's executing on
1900 * is removed from the allowed bitmask.
1901 *
1902 * NOTE: the caller must have a valid reference to the task, the
1903 * task must not exit() & deallocate itself prematurely. The
1904 * call is not atomic; no spinlocks may be held.
1905 */
1906 static int __set_cpus_allowed_ptr(struct task_struct *p,
1907 const struct cpumask *new_mask
1908 u32 flags)
1909 {
1910 const struct cpumask *cpu_valid_mask = cpu_active_mask;
1911 unsigned int dest_cpu;
1912 struct rq_flags rf;
1913 struct rq *rq;
1914 int ret = 0;
1915
1916 rq = task_rq_lock(p, &rf);
1917 update_rq_clock(rq);
1918
1919 if (p->flags & PF_KTHREAD) {
1920 /*
1921 * Kernel threads are allowed on online && !active CPUs
1922 */
1923 cpu_valid_mask = cpu_online_mask;
1924 }
1925
1926 /*
1927 * Must re-check here, to close a race against __kthread_bind(),
1928 * sched_setaffinity() is not guaranteed to observe the flag.
1929 */
1930 if ((flags & SCA_CHECK) && (p->flags & PF_NO_SETAFFINITY)) {
1931 ret = -EINVAL;
1932 goto out;
1933 }
1934
1935 if (!(flags & SCA_MIGRATE_ENABLE) &&
cpumask_equal(&p->cpus_mask, new_mask))
1936 goto out;
1937
1938 /*
1939 * Picking a ~random cpu helps in cases where we are changing affinity
1940 * for groups of tasks (ie. cpuset), so that load balancing is not
1941 * immediately required to distribute the tasks within their new mask.
1942 */
1943 dest_cpu = cpumask_any_and_distribute(cpu_valid_mask, new_mask);
1944 if (dest_cpu >= nr_cpu_ids) {
1945 ret = -EINVAL;
1946 goto out;
1947 }
1948
1949 __do_set_cpus_allowed(p, new_mask, flags);
1950
1951 if (p->flags & PF_KTHREAD) {
1952 /*
1953 * For kernel threads that do indeed end up on online &&
1954 * !active we want to ensure they are strict per-CPU threads.
1955 */
1956 WARN_ON(cpumask_intersects(new_mask, cpu_online_mask) &&
1957 !cpumask_intersects(new_mask, cpu_active_mask) &&
1958 p->nr_cpus_allowed != 1);
1959 }
1960
1961 /* Can the task run on the task's current CPU? If so, we're done */
1962 if (cpumask_test_cpu(task_cpu(p), new_mask))
1963 goto out;
1964
1965 if (task_running(rq, p) || p->state == TASK_WAKING) {
1966 struct migration_arg arg = { p, dest_cpu };
1967 /* Need help from migration thread: drop lock and wait. */
1968 task_rq_unlock(rq, p, &rf);
1969 stop_one_cpu(cpu_of(rq), migration_cpu_stop, &arg);
1970 return 0;
1971 } else if (task_on_rq_queued(p)) {
1972 /*
1973 * OK, since we're going to drop the lock immediately
1974 * afterwards anyway.
1975 */
1976 rq = move_queued_task(rq, &rf, p, dest_cpu);
1977 }
1978 out:
1979 task_rq_unlock(rq, p, &rf);
1980
1981 return ret;
1982 }
1983
1984 int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
1985 {
1986 return __set_cpus_allowed_ptr(p, new_mask, 0);
1987 }
1988 EXPORT_SYMBOL_GPL(set_cpus_allowed_ptr);
1989
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org