Commit ec618b8
Peter Zijlstra
sched: Fix rq->nr_iowait ordering
schedule() ttwu()
deactivate_task(); if (p->on_rq && ...) // false
atomic_dec(&task_rq(p)->nr_iowait);
if (prev->in_iowait)
atomic_inc(&rq->nr_iowait);
Allows nr_iowait to be decremented before it gets incremented,
resulting in more dodgy IO-wait numbers than usual.
Note that because we can now do ttwu_queue_wakelist() before
p->on_cpu==0, we lose the natural ordering and have to further delay
the decrement.
Fixes: c6e7bd7 ("sched/core: Optimize ttwu() spinning on p->on_cpu")
Reported-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Link: https://lkml.kernel.org/r/20201117093829.GD3121429@hirez.programming.kicks-ass.net1 parent f97bb52 commit ec618b8
1 file changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2501 | 2501 | | |
2502 | 2502 | | |
2503 | 2503 | | |
| 2504 | + | |
2504 | 2505 | | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
2505 | 2510 | | |
2506 | 2511 | | |
2507 | 2512 | | |
| |||
2888 | 2893 | | |
2889 | 2894 | | |
2890 | 2895 | | |
2891 | | - | |
2892 | | - | |
2893 | | - | |
2894 | | - | |
2895 | | - | |
2896 | 2896 | | |
2897 | 2897 | | |
2898 | 2898 | | |
| |||
2963 | 2963 | | |
2964 | 2964 | | |
2965 | 2965 | | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
2966 | 2971 | | |
2967 | 2972 | | |
2968 | 2973 | | |
| |||
0 commit comments