Commit dfa0a57
Peter Zijlstra
sched/uclamg: Handle delayed dequeue
Delayed dequeue has tasks sit around on the runqueue that are not
actually runnable -- specifically, they will be dequeued the moment
they get picked.
One side-effect is that such a task can get migrated, which leads to a
'nested' dequeue_task() scenario that messes up uclamp if we don't
take care.
Notably, dequeue_task(DEQUEUE_SLEEP) can 'fail' and keep the task on
the runqueue. This however will have removed the task from uclamp --
per uclamp_rq_dec() in dequeue_task(). So far so good.
However, if at that point the task gets migrated -- or nice adjusted
or any of a myriad of operations that does a dequeue-enqueue cycle --
we'll pass through dequeue_task()/enqueue_task() again. Without
modification this will lead to a double decrement for uclamp, which is
wrong.
Reported-by: Luis Machado <[email protected]>
Reported-by: Hongyan Xia <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Valentin Schneider <[email protected]>
Tested-by: Valentin Schneider <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]1 parent abc158c commit dfa0a57
1 file changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1691 | 1691 | | |
1692 | 1692 | | |
1693 | 1693 | | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
1694 | 1697 | | |
1695 | 1698 | | |
1696 | 1699 | | |
| |||
1715 | 1718 | | |
1716 | 1719 | | |
1717 | 1720 | | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
1718 | 1724 | | |
1719 | 1725 | | |
1720 | 1726 | | |
| |||
1994 | 2000 | | |
1995 | 2001 | | |
1996 | 2002 | | |
1997 | | - | |
1998 | 2003 | | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
1999 | 2009 | | |
2000 | 2010 | | |
2001 | 2011 | | |
| |||
2017 | 2027 | | |
2018 | 2028 | | |
2019 | 2029 | | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
2020 | 2034 | | |
2021 | 2035 | | |
2022 | 2036 | | |
| |||
0 commit comments