Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sched-urgent-2023-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc scheduler fixes from Ingo Molnar:

- Two EEVDF fixes: one to fix sysctl_sched_base_slice propagation, and
to fix an avg_vruntime() corner-case.

- A cpufreq frequency scaling fix

* tag 'sched-urgent-2023-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
cpufreq: schedutil: Update next_freq when cpufreq_limits change
sched/eevdf: Fix avg_vruntime()
sched/eevdf: Also update slice on placement

+15 -4
+2 -1
kernel/sched/cpufreq_schedutil.c
··· 350 350 * Except when the rq is capped by uclamp_max. 351 351 */ 352 352 if (!uclamp_rq_is_capped(cpu_rq(sg_cpu->cpu)) && 353 - sugov_cpu_is_busy(sg_cpu) && next_f < sg_policy->next_freq) { 353 + sugov_cpu_is_busy(sg_cpu) && next_f < sg_policy->next_freq && 354 + !sg_policy->need_freq_update) { 354 355 next_f = sg_policy->next_freq; 355 356 356 357 /* Restore cached freq as next_freq has changed */
+13 -3
kernel/sched/fair.c
··· 664 664 cfs_rq->avg_vruntime -= cfs_rq->avg_load * delta; 665 665 } 666 666 667 + /* 668 + * Specifically: avg_runtime() + 0 must result in entity_eligible() := true 669 + * For this to be so, the result of this function must have a left bias. 670 + */ 667 671 u64 avg_vruntime(struct cfs_rq *cfs_rq) 668 672 { 669 673 struct sched_entity *curr = cfs_rq->curr; ··· 681 677 load += weight; 682 678 } 683 679 684 - if (load) 680 + if (load) { 681 + /* sign flips effective floor / ceil */ 682 + if (avg < 0) 683 + avg -= (load - 1); 685 684 avg = div_s64(avg, load); 685 + } 686 686 687 687 return cfs_rq->min_vruntime + avg; 688 688 } ··· 4927 4919 static void 4928 4920 place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) 4929 4921 { 4930 - u64 vslice = calc_delta_fair(se->slice, se); 4931 - u64 vruntime = avg_vruntime(cfs_rq); 4922 + u64 vslice, vruntime = avg_vruntime(cfs_rq); 4932 4923 s64 lag = 0; 4924 + 4925 + se->slice = sysctl_sched_base_slice; 4926 + vslice = calc_delta_fair(se->slice, se); 4933 4927 4934 4928 /* 4935 4929 * Due to how V is constructed as the weighted average of entities,