[Devel] [PATCH hci-8.1 2/4] sched: keep cfs_rq::nr_iowait balanced for throttled and class changing tasks
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Wed Oct 14 14:24:27 MSK 2026
> Two more paths break the cfs_rq::nr_iowait pairing:
>
> - A throttled task can go to sleep in iowait before it returns to
> user space, e.g. in blkcg_maybe_throttle_current().
> dequeue_throttled_task() doesn't increment the counter but the
> wakeup decrements it, so it wraps around.
> - A sleeping iowait task can change its class through
> sched_setscheduler() or rt_mutex_setprio(). Fair to RT leaves the
> counter incremented forever, RT to fair decrements it without an
> increment.
>
> A CT with both CPU and IO limits hits the first one.
>
> Fix it by incrementing the counter in dequeue_throttled_task() and by
> moving the task between the class counters in check_class_changed(),
> like sched_move_task() does for a cgroup change.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-147823
> Fixes: 415fe063c53e ("sched: Account cfs_rq::nr_iowait")
> Signed-off-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261014-ct-iowait-v1-0-9d65fe37cf89@virtuozzo.com?part=2
More information about the Devel
mailing list