]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: Add support for napi_busy_poll
authorOlivier Langlois <olivier@trillion01.com>
Tue, 8 Mar 2022 22:17:26 +0000 (17:17 -0500)
committerJens Axboe <axboe@kernel.dk>
Thu, 10 Mar 2022 16:18:30 +0000 (09:18 -0700)
commitf6473fc58c5d053e16ed4fa18a0c592392c6a0f8
tree7d701cfbb64225cbe40b30802f97641bd41a0a1a
parent21eab7f549e8978968dc9ed3a70b297d42e1f949
io_uring: Add support for napi_busy_poll

The sqpoll thread can be used for performing the napi busy poll in a
similar way that it does io polling for file systems supporting direct
access bypassing the page cache.

The other way that io_uring can be used for napi busy poll is by
calling io_uring_enter() to get events.

If the user specify a timeout value, it is distributed between polling
and sleeping by using the systemwide setting
/proc/sys/net/core/busy_poll.

The changes have been tested with this program:
https://github.com/lano1106/io_uring_udp_ping

and the result is:
Without sqpoll:
NAPI busy loop disabled:
rtt min/avg/max/mdev = 40.631/42.050/58.667/1.547 us
NAPI busy loop enabled:
rtt min/avg/max/mdev = 30.619/31.753/61.433/1.456 us

With sqpoll:
NAPI busy loop disabled:
rtt min/avg/max/mdev = 42.087/44.438/59.508/1.533 us
NAPI busy loop enabled:
rtt min/avg/max/mdev = 35.779/37.347/52.201/0.924 us

Co-developed-by: Hao Xu <haoxu@linux.alibaba.com>
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Link: https://lore.kernel.org/r/810bd9408ffc510ff08269e78dca9df4af0b9e4e.1646777484.git.olivier@trillion01.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c