Commit be39617
sched: Fix proxy/current (push,pull)ability
Proxy execution forms atomic pairs of tasks: The waiting donor
task (scheduling context) and a proxy (execution context). The
donor task, along with the rest of the blocked chain, follows
the proxy wrt CPU placement.
They can be the same task, in which case push/pull doesn't need any
modification. When they are different, however,
FIFO1 & FIFO42:
,-> RT42
| | blocked-on
| v
blocked_donor | mutex
| | owner
| v
`-- RT1
RT1
RT42
CPU0 CPU1
^ ^
| |
overloaded !overloaded
rq prio = 42 rq prio = 0
RT1 is eligible to be pushed to CPU1, but should that happen it will
"carry" RT42 along. Clearly here neither RT1 nor RT42 must be seen as
push/pullable.
Unfortunately, only the donor task is usually dequeued from the rq,
and the proxy'ed execution context (rq->curr) remains on the rq.
This can cause RT1 to be selected for migration from logic like the
rt pushable_list.
Thus, adda a dequeue/enqueue cycle on the proxy task before __schedule
returns, which allows the sched class logic to avoid adding the now
current task to the pushable_list.
Furthermore, tasks becoming blocked on a mutex don't need an explicit
dequeue/enqueue cycle to be made (push/pull)able: they have to be running
to block on a mutex, thus they will eventually hit put_prev_task().
Signed-off-by: Valentin Schneider <[email protected]>
Signed-off-by: Connor O'Brien <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Tested-by: K Prateek Nayak <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]1 parent be41bde commit be39617
3 files changed
+37
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6654 | 6654 | | |
6655 | 6655 | | |
6656 | 6656 | | |
| 6657 | + | |
| 6658 | + | |
| 6659 | + | |
| 6660 | + | |
| 6661 | + | |
| 6662 | + | |
| 6663 | + | |
| 6664 | + | |
| 6665 | + | |
| 6666 | + | |
| 6667 | + | |
| 6668 | + | |
| 6669 | + | |
| 6670 | + | |
| 6671 | + | |
| 6672 | + | |
| 6673 | + | |
6657 | 6674 | | |
6658 | 6675 | | |
6659 | 6676 | | |
| |||
6798 | 6815 | | |
6799 | 6816 | | |
6800 | 6817 | | |
| 6818 | + | |
| 6819 | + | |
| 6820 | + | |
| 6821 | + | |
6801 | 6822 | | |
6802 | 6823 | | |
6803 | 6824 | | |
| |||
6832 | 6853 | | |
6833 | 6854 | | |
6834 | 6855 | | |
| 6856 | + | |
| 6857 | + | |
| 6858 | + | |
| 6859 | + | |
6835 | 6860 | | |
6836 | 6861 | | |
6837 | 6862 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2121 | 2121 | | |
2122 | 2122 | | |
2123 | 2123 | | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
2124 | 2127 | | |
2125 | 2128 | | |
2126 | 2129 | | |
| |||
2415 | 2418 | | |
2416 | 2419 | | |
2417 | 2420 | | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
2418 | 2425 | | |
2419 | 2426 | | |
2420 | 2427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
1443 | 1446 | | |
1444 | 1447 | | |
1445 | 1448 | | |
| |||
1716 | 1719 | | |
1717 | 1720 | | |
1718 | 1721 | | |
| 1722 | + | |
| 1723 | + | |
1719 | 1724 | | |
1720 | 1725 | | |
1721 | 1726 | | |
| |||
0 commit comments