Commit 4c2a204
sched: Add is_blocked task flag
Add a new is_blocked flag to the task struct. This flag is set
by try_to_block_task() and cleared by ttwu_do_wakeup() and
tracks if the task is blocked.
Traditionally this would mirror !p->on_rq, however due things
like DELAY_DEQUEUE and PROXY_EXEC, this can diverge, so its
useful to manage separately.
Additionally with this, we might be able to get rid of the
p->se.sched_delayed (ab)use in the core code (eventually).
Taken whole cloth from Peter's email:
https://lore.kernel.org/lkml/20260501132143.GC1026330@noisy.programming.kicks-ass.net/
With a few additional p->is_blocked = 0 in a few cases where
we return current if blocked_on gets zeroed or there is
no owner. This may hint that these current special cases
might be dropped eventually.
This change also helps resolve wait-queue stalls seen with
proxy-execution. See previous patch attempts for details:
https://lore.kernel.org/lkml/20260430215103.2978955-2-jstultz@google.com/
Reported-by: Vineeth Pillai <vineethrp@google.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: John Stultz <jstultz@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260512025635.2840817-7-jstultz@google.com1 parent f13beb0 commit 4c2a204
2 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
852 | 852 | | |
853 | 853 | | |
854 | 854 | | |
855 | | - | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
856 | 860 | | |
857 | 861 | | |
858 | 862 | | |
| |||
867 | 871 | | |
868 | 872 | | |
869 | 873 | | |
870 | | - | |
871 | 874 | | |
872 | 875 | | |
873 | 876 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
627 | 633 | | |
628 | 634 | | |
629 | 635 | | |
| |||
3719 | 3725 | | |
3720 | 3726 | | |
3721 | 3727 | | |
| 3728 | + | |
3722 | 3729 | | |
3723 | 3730 | | |
3724 | 3731 | | |
| |||
4252 | 4259 | | |
4253 | 4260 | | |
4254 | 4261 | | |
| 4262 | + | |
4255 | 4263 | | |
4256 | 4264 | | |
4257 | 4265 | | |
| |||
4563 | 4571 | | |
4564 | 4572 | | |
4565 | 4573 | | |
| 4574 | + | |
4566 | 4575 | | |
4567 | 4576 | | |
4568 | 4577 | | |
| |||
6676 | 6685 | | |
6677 | 6686 | | |
6678 | 6687 | | |
| 6688 | + | |
6679 | 6689 | | |
6680 | 6690 | | |
6681 | 6691 | | |
6682 | 6692 | | |
6683 | 6693 | | |
6684 | 6694 | | |
6685 | 6695 | | |
| 6696 | + | |
| 6697 | + | |
6686 | 6698 | | |
6687 | 6699 | | |
6688 | 6700 | | |
| |||
6843 | 6855 | | |
6844 | 6856 | | |
6845 | 6857 | | |
| 6858 | + | |
6846 | 6859 | | |
6847 | 6860 | | |
6848 | 6861 | | |
| |||
6878 | 6891 | | |
6879 | 6892 | | |
6880 | 6893 | | |
| 6894 | + | |
6881 | 6895 | | |
6882 | 6896 | | |
6883 | 6897 | | |
| |||
7111 | 7125 | | |
7112 | 7126 | | |
7113 | 7127 | | |
7114 | | - | |
| 7128 | + | |
7115 | 7129 | | |
7116 | 7130 | | |
7117 | 7131 | | |
| |||
0 commit comments