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_for_v6.16_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Borislav Petkov:

- Fix the calculation of the deadline server task's runtime as this
mishap was preventing realtime tasks from running

- Avoid a race condition during migrate-swapping two tasks

- Fix the string reported for the "none" dynamic preemption option

* tag 'sched_urgent_for_v6.16_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/deadline: Fix dl_server runtime calculation formula
sched/core: Fix migrate_swap() vs. hotplug
sched: Fix preemption string of preempt_dynamic_none

+21 -16
+6 -1
kernel/sched/core.c
··· 3943 3943 if (!scx_allow_ttwu_queue(p)) 3944 3944 return false; 3945 3945 3946 + #ifdef CONFIG_SMP 3947 + if (p->sched_class == &stop_sched_class) 3948 + return false; 3949 + #endif 3950 + 3946 3951 /* 3947 3952 * Do not complicate things with the async wake_list while the CPU is 3948 3953 * in hotplug state. ··· 7668 7663 7669 7664 if (IS_ENABLED(CONFIG_PREEMPT_DYNAMIC)) { 7670 7665 seq_buf_printf(&s, "(%s)%s", 7671 - preempt_dynamic_mode > 0 ? 7666 + preempt_dynamic_mode >= 0 ? 7672 7667 preempt_modes[preempt_dynamic_mode] : "undef", 7673 7668 brace ? "}" : ""); 7674 7669 return seq_buf_str(&s);
+5 -5
kernel/sched/deadline.c
··· 1504 1504 if (dl_entity_is_special(dl_se)) 1505 1505 return; 1506 1506 1507 - scaled_delta_exec = dl_scaled_delta_exec(rq, dl_se, delta_exec); 1507 + scaled_delta_exec = delta_exec; 1508 + if (!dl_server(dl_se)) 1509 + scaled_delta_exec = dl_scaled_delta_exec(rq, dl_se, delta_exec); 1508 1510 1509 1511 dl_se->runtime -= scaled_delta_exec; 1510 1512 ··· 1613 1611 */ 1614 1612 void dl_server_update_idle_time(struct rq *rq, struct task_struct *p) 1615 1613 { 1616 - s64 delta_exec, scaled_delta_exec; 1614 + s64 delta_exec; 1617 1615 1618 1616 if (!rq->fair_server.dl_defer) 1619 1617 return; ··· 1626 1624 if (delta_exec < 0) 1627 1625 return; 1628 1626 1629 - scaled_delta_exec = dl_scaled_delta_exec(rq, &rq->fair_server, delta_exec); 1630 - 1631 - rq->fair_server.runtime -= scaled_delta_exec; 1627 + rq->fair_server.runtime -= delta_exec; 1632 1628 1633 1629 if (rq->fair_server.runtime < 0) { 1634 1630 rq->fair_server.dl_defer_running = 0;
+10 -10
kernel/stop_machine.c
··· 82 82 } 83 83 84 84 static void __cpu_stop_queue_work(struct cpu_stopper *stopper, 85 - struct cpu_stop_work *work, 86 - struct wake_q_head *wakeq) 85 + struct cpu_stop_work *work) 87 86 { 88 87 list_add_tail(&work->list, &stopper->works); 89 - wake_q_add(wakeq, stopper->thread); 90 88 } 91 89 92 90 /* queue @work to @stopper. if offline, @work is completed immediately */ 93 91 static bool cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work) 94 92 { 95 93 struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu); 96 - DEFINE_WAKE_Q(wakeq); 97 94 unsigned long flags; 98 95 bool enabled; 99 96 ··· 98 101 raw_spin_lock_irqsave(&stopper->lock, flags); 99 102 enabled = stopper->enabled; 100 103 if (enabled) 101 - __cpu_stop_queue_work(stopper, work, &wakeq); 104 + __cpu_stop_queue_work(stopper, work); 102 105 else if (work->done) 103 106 cpu_stop_signal_done(work->done); 104 107 raw_spin_unlock_irqrestore(&stopper->lock, flags); 105 108 106 - wake_up_q(&wakeq); 109 + if (enabled) 110 + wake_up_process(stopper->thread); 107 111 preempt_enable(); 108 112 109 113 return enabled; ··· 262 264 { 263 265 struct cpu_stopper *stopper1 = per_cpu_ptr(&cpu_stopper, cpu1); 264 266 struct cpu_stopper *stopper2 = per_cpu_ptr(&cpu_stopper, cpu2); 265 - DEFINE_WAKE_Q(wakeq); 266 267 int err; 267 268 268 269 retry: ··· 297 300 } 298 301 299 302 err = 0; 300 - __cpu_stop_queue_work(stopper1, work1, &wakeq); 301 - __cpu_stop_queue_work(stopper2, work2, &wakeq); 303 + __cpu_stop_queue_work(stopper1, work1); 304 + __cpu_stop_queue_work(stopper2, work2); 302 305 303 306 unlock: 304 307 raw_spin_unlock(&stopper2->lock); ··· 313 316 goto retry; 314 317 } 315 318 316 - wake_up_q(&wakeq); 319 + if (!err) { 320 + wake_up_process(stopper1->thread); 321 + wake_up_process(stopper2->thread); 322 + } 317 323 preempt_enable(); 318 324 319 325 return err;