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

Merge tag 'sched-urgent-2025-12-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar:
"Miscellaneous scheduler fixes/cleanups:

- Fix psi_dequeue() for Proxy Execution

- Fix hrtick() vs. scheduling context bug

- Fix unfairness caused by stalled tg_load_avg_contrib when the last
task migrates out

- Fix whitespace noise in headers

- Remove a preempt-disable section in rt_mutex_setprio()"

* tag 'sched-urgent-2025-12-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/core: Fix psi_dequeue() for Proxy Execution
sched/fair: Fix unfairness caused by stalled tg_load_avg_contrib when the last task migrates out
sched/rt: Remove a preempt-disable section in rt_mutex_setprio()
sched/hrtick: Fix hrtick() vs. scheduling context
sched/headers: Remove whitespace noise from kernel/sched/sched.h

+12 -7
+2 -5
kernel/sched/core.c
··· 878 878 879 879 rq_lock(rq, &rf); 880 880 update_rq_clock(rq); 881 - rq->donor->sched_class->task_tick(rq, rq->curr, 1); 881 + rq->donor->sched_class->task_tick(rq, rq->donor, 1); 882 882 rq_unlock(rq, &rf); 883 883 884 884 return HRTIMER_NORESTART; ··· 7360 7360 p->prio = prio; 7361 7361 } 7362 7362 out_unlock: 7363 - /* Avoid rq from going away on us: */ 7364 - preempt_disable(); 7363 + /* Caller holds task_struct::pi_lock, IRQs are still disabled */ 7365 7364 7366 7365 rq_unpin_lock(rq, &rf); 7367 7366 __balance_callbacks(rq); 7368 7367 rq_repin_lock(rq, &rf); 7369 7368 __task_rq_unlock(rq, p, &rf); 7370 - 7371 - preempt_enable(); 7372 7369 } 7373 7370 #endif /* CONFIG_RT_MUTEXES */ 7374 7371
+3
kernel/sched/fair.c
··· 4034 4034 if (child_cfs_rq_on_list(cfs_rq)) 4035 4035 return false; 4036 4036 4037 + if (cfs_rq->tg_load_avg_contrib) 4038 + return false; 4039 + 4037 4040 return true; 4038 4041 } 4039 4042
+1 -1
kernel/sched/sched.h
··· 1167 1167 * one CPU and if it got migrated afterwards it may decrease 1168 1168 * it on another CPU. Always updated under the runqueue lock: 1169 1169 */ 1170 - unsigned long nr_uninterruptible; 1170 + unsigned long nr_uninterruptible; 1171 1171 1172 1172 #ifdef CONFIG_SCHED_PROXY_EXEC 1173 1173 struct task_struct __rcu *donor; /* Scheduling context */
+6 -1
kernel/sched/stats.h
··· 180 180 * avoid walking all ancestors twice, psi_task_switch() handles 181 181 * TSK_RUNNING and TSK_IOWAIT for us when it moves TSK_ONCPU. 182 182 * Do nothing here. 183 + * 184 + * In the SCHED_PROXY_EXECUTION case we may do sleeping 185 + * dequeues that are not followed by a task switch, so check 186 + * TSK_ONCPU is set to ensure the task switch is imminent. 187 + * Otherwise clear the flags as usual. 183 188 */ 184 - if (flags & DEQUEUE_SLEEP) 189 + if ((flags & DEQUEUE_SLEEP) && (p->psi_flags & TSK_ONCPU)) 185 190 return; 186 191 187 192 /*