Re: [PATCH 2/4] sched/fair: Make CFS bandwidth controller burstable

From: kernel test robot
Date: Fri Dec 18 2020 - 04:55:16 EST


Hi Huaixin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/sched/core]
[also build test ERROR on tip/master linus/master v5.10 next-20201217]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Huaixin-Chang/sched-fair-Burstable-CFS-bandwidth-controller/20201217-155214
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 5b78f2dc315354c05300795064f587366a02c6ff
config: i386-randconfig-r013-20200812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/d2f5cde464c872307ee33f78ba167a6f3334697c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Huaixin-Chang/sched-fair-Burstable-CFS-bandwidth-controller/20201217-155214
git checkout d2f5cde464c872307ee33f78ba167a6f3334697c
# save the attached .config to linux build tree
make W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

ld: kernel/sched/core.o: in function `tg_set_cfs_bandwidth':
>> kernel/sched/core.c:8596: undefined reference to `__udivdi3'


vim +8596 kernel/sched/core.c

8521
8522 static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota,
8523 u64 burst)
8524 {
8525 int i, ret = 0, runtime_enabled, runtime_was_enabled;
8526 struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth;
8527 u64 buffer, burst_onset;
8528
8529 if (tg == &root_task_group)
8530 return -EINVAL;
8531
8532 /*
8533 * Ensure we have at some amount of bandwidth every period. This is
8534 * to prevent reaching a state of large arrears when throttled via
8535 * entity_tick() resulting in prolonged exit starvation.
8536 */
8537 if (quota < min_cfs_quota_period || period < min_cfs_quota_period)
8538 return -EINVAL;
8539
8540 /*
8541 * Likewise, bound things on the otherside by preventing insane quota
8542 * periods. This also allows us to normalize in computing quota
8543 * feasibility.
8544 */
8545 if (period > max_cfs_quota_period)
8546 return -EINVAL;
8547
8548 /*
8549 * Bound quota to defend quota against overflow during bandwidth shift.
8550 */
8551 if (quota != RUNTIME_INF && quota > max_cfs_runtime)
8552 return -EINVAL;
8553
8554 /*
8555 * Bound burst to defend burst against overflow during bandwidth shift.
8556 */
8557 if (burst > max_cfs_runtime)
8558 return -EINVAL;
8559
8560 if (quota == RUNTIME_INF)
8561 buffer = RUNTIME_INF;
8562 else
8563 buffer = min(max_cfs_runtime, quota + burst);
8564 /*
8565 * Prevent race between setting of cfs_rq->runtime_enabled and
8566 * unthrottle_offline_cfs_rqs().
8567 */
8568 get_online_cpus();
8569 mutex_lock(&cfs_constraints_mutex);
8570 ret = __cfs_schedulable(tg, period, quota);
8571 if (ret)
8572 goto out_unlock;
8573
8574 runtime_enabled = quota != RUNTIME_INF;
8575 runtime_was_enabled = cfs_b->quota != RUNTIME_INF;
8576 /*
8577 * If we need to toggle cfs_bandwidth_used, off->on must occur
8578 * before making related changes, and on->off must occur afterwards
8579 */
8580 if (runtime_enabled && !runtime_was_enabled)
8581 cfs_bandwidth_usage_inc();
8582 raw_spin_lock_irq(&cfs_b->lock);
8583 cfs_b->period = ns_to_ktime(period);
8584 cfs_b->quota = quota;
8585 cfs_b->burst = burst;
8586 cfs_b->buffer = buffer;
8587
8588 cfs_b->max_overrun = DIV_ROUND_UP_ULL(max_cfs_runtime, quota);
8589 cfs_b->runtime = cfs_b->quota;
8590
8591 /* burst_onset needed */
8592 if (cfs_b->quota != RUNTIME_INF &&
8593 sysctl_sched_cfs_bw_burst_enabled &&
8594 sysctl_sched_cfs_bw_burst_onset_percent > 0) {
8595
> 8596 burst_onset = burst / 100 *
8597 sysctl_sched_cfs_bw_burst_onset_percent;
8598
8599 cfs_b->runtime += burst_onset;
8600 cfs_b->runtime = min(max_cfs_runtime, cfs_b->runtime);
8601 }
8602
8603 /* Restart the period timer (if active) to handle new period expiry: */
8604 if (runtime_enabled)
8605 start_cfs_bandwidth(cfs_b, 1);
8606
8607 raw_spin_unlock_irq(&cfs_b->lock);
8608
8609 for_each_online_cpu(i) {
8610 struct cfs_rq *cfs_rq = tg->cfs_rq[i];
8611 struct rq *rq = cfs_rq->rq;
8612 struct rq_flags rf;
8613
8614 rq_lock_irq(rq, &rf);
8615 cfs_rq->runtime_enabled = runtime_enabled;
8616 cfs_rq->runtime_remaining = 0;
8617
8618 if (cfs_rq->throttled)
8619 unthrottle_cfs_rq(cfs_rq);
8620 rq_unlock_irq(rq, &rf);
8621 }
8622 if (runtime_was_enabled && !runtime_enabled)
8623 cfs_bandwidth_usage_dec();
8624 out_unlock:
8625 mutex_unlock(&cfs_constraints_mutex);
8626 put_online_cpus();
8627
8628 return ret;
8629 }
8630

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip