mirror of https://github.com/torvalds/linux.git
Fix a group-throttling bug in the fair scheduler.
Signed-off-by: Ingo Molnar <mingo@kernel.org> -----BEGIN PGP SIGNATURE----- iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmkPQRgRHG1pbmdvQGtl cm5lbC5vcmcACgkQEnMQ0APhK1jtjQ//UM9YfdauTXacEE2dPG4b0QwxHPgMsFmS GMT7c6H7ApCQoiBnGwv3K0d0bu4FZwnWBMulUv/yhe49vHXdIPdZAlMkJrM3IA7X 80IVCfLHtRkbMaAUIDc3MGwkzneCUIuzKPPH1iXqn9/R0zBB8S7qxt4XHyBHzlX7 uCNbFkUFhrh5s3sWond2ogAlCvGiZ5Qo7/oTfNrpOmYGvXfNIh4T1zDOWpPrsKLX Md6rucBs0bcV1vlyKwNrobqOuaS0mdSxjt+SKDuI1CdCj6mNbYvjLPinnAi2n3zZ CLaI8+rBe3JpLOH+kXuOf+CUatXDBjF4GO1k6XXwvcsK4ARqmKcbk9Xs3i/Tn/bm Ls7IdLkCrekXaGU2MlYLVg0twe+O5oUgwBpa4Ap/IObbI+fIKP/Pj2blZlpT1RlY J455LrldsMUy1NWaqVd13gCGOPGzR6SrD+ruOJS4BAK3JFyRw8rdDW4zJ7qEiCRj yejZfiFcCAoD7cqFJoCon6rt+WC3T5I1/Sc40JCmfKH/GhLzTAGt/8cRaic4ntRX Yv8T/lJVgjhGqfDWmcRYZVF/SiyZq8IP+wqrpr3ETAfRhqB5ZhQHPUGZPPDDeeqH QHEYSrWdbmxKqYpBK3nwgwAIz9dSJcdQUqWLvP85rjRTeLr08/reXha4P80RJ3wz XmLzR7KQ9mI= =zLw8 -----END PGP SIGNATURE----- Merge tag 'sched-urgent-2025-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Ingo Molnar: "Fix a group-throttling bug in the fair scheduler" * tag 'sched-urgent-2025-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Prevent cfs_rq from being unthrottled with zero runtime_remaining
This commit is contained in:
commit
b5c0946029
|
|
@ -9606,7 +9606,7 @@ static int tg_set_cfs_bandwidth(struct task_group *tg,
|
|||
|
||||
guard(rq_lock_irq)(rq);
|
||||
cfs_rq->runtime_enabled = runtime_enabled;
|
||||
cfs_rq->runtime_remaining = 0;
|
||||
cfs_rq->runtime_remaining = 1;
|
||||
|
||||
if (cfs_rq->throttled)
|
||||
unthrottle_cfs_rq(cfs_rq);
|
||||
|
|
|
|||
|
|
@ -6024,20 +6024,17 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
|
|||
struct sched_entity *se = cfs_rq->tg->se[cpu_of(rq)];
|
||||
|
||||
/*
|
||||
* It's possible we are called with !runtime_remaining due to things
|
||||
* like user changed quota setting(see tg_set_cfs_bandwidth()) or async
|
||||
* unthrottled us with a positive runtime_remaining but other still
|
||||
* running entities consumed those runtime before we reached here.
|
||||
* It's possible we are called with runtime_remaining < 0 due to things
|
||||
* like async unthrottled us with a positive runtime_remaining but other
|
||||
* still running entities consumed those runtime before we reached here.
|
||||
*
|
||||
* Anyway, we can't unthrottle this cfs_rq without any runtime remaining
|
||||
* because any enqueue in tg_unthrottle_up() will immediately trigger a
|
||||
* throttle, which is not supposed to happen on unthrottle path.
|
||||
* We can't unthrottle this cfs_rq without any runtime remaining because
|
||||
* any enqueue in tg_unthrottle_up() will immediately trigger a throttle,
|
||||
* which is not supposed to happen on unthrottle path.
|
||||
*/
|
||||
if (cfs_rq->runtime_enabled && cfs_rq->runtime_remaining <= 0)
|
||||
return;
|
||||
|
||||
se = cfs_rq->tg->se[cpu_of(rq)];
|
||||
|
||||
cfs_rq->throttled = 0;
|
||||
|
||||
update_rq_clock(rq);
|
||||
|
|
|
|||
Loading…
Reference in New Issue