]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched/fair: Do not special case tasks in throttled hierarchy
authorAaron Lu <ziqianlu@bytedance.com>
Wed, 10 Sep 2025 09:50:43 +0000 (17:50 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 15 Sep 2025 07:38:37 +0000 (09:38 +0200)
commit253b3f587241967a97a971e23b1e2a7d74244fad
tree77155dc28632bedb4681b8781930ef4721c9d03d
parentfcd394866e3db344cbe0bb485d7e3f741ac07245
sched/fair: Do not special case tasks in throttled hierarchy

With the introduction of task based throttle model, task in a throttled
hierarchy is allowed to continue to run till it gets throttled on its
ret2user path.

For this reason, remove those throttled_hierarchy() checks in the
following functions so that those tasks can get their turn as normal
tasks: dequeue_entities(), check_preempt_wakeup_fair() and
yield_to_task_fair().

The benefit of doing it this way is: if those tasks gets the chance to
run earlier and if they hold any kernel resources, they can release
those resources earlier. The downside is, if they don't hold any kernel
resouces, all they can do is to throttle themselves on their way back to
user space so the favor to let them run seems not that useful and for
check_preempt_wakeup_fair(), that favor may be bad for curr.

K Prateek Nayak pointed out prio_changed_fair() can send a throttled
task to check_preempt_wakeup_fair(), further tests showed the affinity
change path from move_queued_task() can also send a throttled task to
check_preempt_wakeup_fair(), that's why the check of task_is_throttled()
in that function.

Signed-off-by: Aaron Lu <ziqianlu@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
kernel/sched/fair.c