tree:
https://github.com/rgushchin/linux.git bpfsched.rfc
head: f4c466accae6c27a4fbece80f8cec431f685a20c
commit: b70be3f6434db637797b13c3680a698ab96a5df3 [5/7] sched: cfs: add bpf hooks to
control wakeup and tick preemption
config: s390-randconfig-r033-20210915 (attached as .config)
compiler: s390-linux-gcc (GCC) 11.2.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
#
https://github.com/rgushchin/linux/commit/b70be3f6434db637797b13c3680a698...
git remote add rgushchin
https://github.com/rgushchin/linux.git
git fetch --no-tags rgushchin bpfsched.rfc
git checkout b70be3f6434db637797b13c3680a698ab96a5df3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390
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/fair.c: In function 'check_preempt_tick':
> kernel/sched/fair.c:4453:27: error: implicit declaration of
function 'bpf_sched_cfs_check_preempt_tick'
[-Werror=implicit-function-declaration]
4453 | int ret =
bpf_sched_cfs_check_preempt_tick(curr, delta_exec);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/fair.c: At top level:
kernel/sched/fair.c:5493:6: warning: no previous prototype for
'init_cfs_bandwidth' [-Wmissing-prototypes]
5493 | void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {}
| ^~~~~~~~~~~~~~~~~~
kernel/sched/fair.c: In function 'wakeup_preempt_entity':
> kernel/sched/fair.c:7098:27: error: implicit declaration of
function 'bpf_sched_cfs_wakeup_preempt_entity'
[-Werror=implicit-function-declaration]
7098 | int ret =
bpf_sched_cfs_wakeup_preempt_entity(curr, se);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/fair.c: In function 'check_preempt_wakeup':
> kernel/sched/fair.c:7190:27: error: implicit declaration of
function 'bpf_sched_cfs_check_preempt_wakeup'
[-Werror=implicit-function-declaration]
7190 | int ret =
bpf_sched_cfs_check_preempt_wakeup(current, p);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/fair.c: At top level:
kernel/sched/fair.c:11631:6: warning: no previous prototype for
'free_fair_sched_group' [-Wmissing-prototypes]
11631 | void free_fair_sched_group(struct task_group *tg) { }
| ^~~~~~~~~~~~~~~~~~~~~
kernel/sched/fair.c:11633:5: warning: no previous prototype for
'alloc_fair_sched_group' [-Wmissing-prototypes]
11633 | int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
| ^~~~~~~~~~~~~~~~~~~~~~
kernel/sched/fair.c:11638:6: warning: no previous prototype for
'online_fair_sched_group' [-Wmissing-prototypes]
11638 | void online_fair_sched_group(struct task_group *tg) { }
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/sched/fair.c:11640:6: warning: no previous prototype for
'unregister_fair_sched_group' [-Wmissing-prototypes]
11640 | void unregister_fair_sched_group(struct task_group *tg) { }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/bpf_sched_cfs_check_preempt_tick +4453 kernel/sched/fair.c
4438
4439 /*
4440 * Preempt the current task with a newly woken task if needed:
4441 */
4442 static void
4443 check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
4444 {
4445 unsigned long ideal_runtime, delta_exec;
4446 struct sched_entity *se;
4447 s64 delta;
4448
4449 ideal_runtime = sched_slice(cfs_rq, curr);
4450 delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
4451
4452 if (bpf_sched_enabled()) {
4453 int ret = bpf_sched_cfs_check_preempt_tick(curr, delta_exec);
4454
4455 if (ret < 0)
4456 return;
4457 else if (ret > 0)
4458 resched_curr(rq_of(cfs_rq));
4459 }
4460
4461 if (delta_exec > ideal_runtime) {
4462 resched_curr(rq_of(cfs_rq));
4463 /*
4464 * The current task ran long enough, ensure it doesn't get
4465 * re-elected due to buddy favours.
4466 */
4467 clear_buddies(cfs_rq, curr);
4468 return;
4469 }
4470
4471 /*
4472 * Ensure that a task that missed wakeup preemption by a
4473 * narrow margin doesn't have to wait for a full slice.
4474 * This also mitigates buddy induced latencies under load.
4475 */
4476 if (delta_exec < sysctl_sched_min_granularity)
4477 return;
4478
4479 se = __pick_first_entity(cfs_rq);
4480 delta = curr->vruntime - se->vruntime;
4481
4482 if (delta < 0)
4483 return;
4484
4485 if (delta > ideal_runtime)
4486 resched_curr(rq_of(cfs_rq));
4487 }
4488
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org