BACKPORT: io_uring: enable toggle of iowait usage when waiting on CQEs
By default, io_uring marks a waiting task as being in iowait, if it's sleeping waiting on events and there are pending requests. This isn't necessarily always useful, and may be confusing on non-storage setups where iowait isn't expected. It can also cause extra power usage, by preventing the CPU from entering lower sleep states. This adds a new enter flag, IORING_ENTER_NO_IOWAIT. If set, then io_uring will not account the sleeping task as being in iowait. If the kernel supports this feature, then it will be marked by having the IORING_FEAT_NO_IOWAIT feature flag set. As the kernel currently does not support separating the iowait accounting and CPU frequency boosting, the IORING_ENTER_NO_IOWAIT controls both of these at the same time. In the future, if those do end up being split, then it'd be possible to control them separately. However, it seems more likely that the kernel will decouple iowait and CPU frequency boosting anyway. Bug: 297114355 (cherry picked from commit 07754bfd) [ akailash: Pass iowait as a function argument to __io_cqring_wait_schedule() and io_get_ext_arg() ] Change-Id: Ia6971a99fed1b52a2208d2e5dee044462b01a0c5 Signed-off-by:Jens Axboe <axboe@kernel.dk> Signed-off-by:
Akilesh Kailash <akailash@google.com>
Loading