Re: [PATCH] kernel/sched/fair: Fix the issue of virtual runtime conversion error

From: Geert Uytterhoeven

Date: Wed May 27 2026 - 02:55:53 EST


On Wed, 27 May 2026 at 03:17, kernel test robot <lkp@xxxxxxxxx> wrote:
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on tip/sched/core]
> [also build test ERROR on peterz-queue/sched/core linus/master v7.1-rc5 next-20260526]
> [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#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Li-kunyu/kernel-sched-fair-Fix-the-issue-of-virtual-runtime-conversion-error/20260526-151853
> base: tip/sched/core
> patch link: https://lore.kernel.org/r/20260526071537.17460-1-likunyu10%40163.com
> patch subject: [PATCH] kernel/sched/fair: Fix the issue of virtual runtime conversion error
> config: i386-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20260527/202605270352.wVynZOtB-lkp@xxxxxxxxx/config)
> compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260527/202605270352.wVynZOtB-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202605270352.wVynZOtB-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> ld: kernel/sched/fair.o: in function `hrtick_start_fair':
> >> kernel/sched/fair.c:7633:(.text+0x701): undefined reference to `__udivdi3'
>
>
> vim +7633 kernel/sched/fair.c
>
> 7603
> 7604 /**************************************************
> 7605 * CFS operations on tasks:
> 7606 */
> 7607
> 7608 #ifdef CONFIG_SCHED_HRTICK
> 7609 static void hrtick_start_fair(struct rq *rq, struct task_struct *p)
> 7610 {
> 7611 struct sched_entity *se = &p->se;
> 7612 unsigned long scale = 1024;
> 7613 unsigned long util = 0;
> 7614 u64 vdelta;
> 7615 u64 delta;
> 7616
> 7617 WARN_ON_ONCE(task_rq(p) != rq);
> 7618
> 7619 if (rq->cfs.h_nr_queued <= 1)
> 7620 return;
> 7621
> 7622 /*
> 7623 * Compute time until virtual deadline
> 7624 */
> 7625 vdelta = se->deadline - se->vruntime;
> 7626 if ((s64)vdelta < 0) {
> 7627 if (task_current_donor(rq, p))
> 7628 resched_curr(rq);
> 7629 return;
> 7630 }
> 7631
> 7632 if (unlikely(se->load.weight != NICE_0_LOAD))
> > 7633 delta = (NICE_0_LOAD * vdelta) / se->load.weight;

vdelta is u64, load_weight.weight is unsigned long, so please use
div64_ul() instead of an open-coded division.

> 7634
> 7635 /*
> 7636 * Correct for instantaneous load of other classes.
> 7637 */
> 7638 util += cpu_util_irq(rq);
> 7639 if (util && util < 1024) {
> 7640 scale *= 1024;
> 7641 scale /= (1024 - util);
> 7642 }
> 7643
> 7644 hrtick_start(rq, (scale * delta) / 1024);
> 7645 }
> 7646

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds