sched: rq->nr_iowait transiently going negative after the recent p->on_cpu optimization

From: Tejun Heo
Date: Fri Sep 18 2020 - 13:28:04 EST


Hello,

Peter, I noticed /proc/stat::procs_blocked going U64_MAX transiently once in
the blue moon without any other persistent issues. After looking at the code
with Rik for a bit, the culprit seems to be c6e7bd7afaeb ("sched/core:
Optimize ttwu() spinning on p->on_cpu") - it changed where ttwu dec's
nr_iowait and it looks like that can happen before the target task gets to
inc.

Thanks.

--
tejun