]> Git Repo - linux.git/commit
io_uring/napi: use ktime in busy polling
authorPavel Begunkov <[email protected]>
Fri, 26 Jul 2024 14:24:30 +0000 (15:24 +0100)
committerJens Axboe <[email protected]>
Fri, 26 Jul 2024 14:31:59 +0000 (08:31 -0600)
commit342b2e395d5f34c9f111a818556e617939f83a8c
tree4e09d19146f6e741dd98faeb071514a376085ff4
parent0db4618e8fabfcc404af4dda23799bba726785a5
io_uring/napi: use ktime in busy polling

It's more natural to use ktime/ns instead of keeping around usec,
especially since we're comparing it against user provided timers,
so convert napi busy poll internal handling to ktime. It's also nicer
since the type (ktime_t vs unsigned long) now tells the unit of measure.

Keep everything as ktime, which we convert to/from micro seconds for
IORING_[UN]REGISTER_NAPI. The net/ busy polling works seems to work with
usec, however it's not real usec as shift by 10 is used to get it from
nsecs, see busy_loop_current_time(), so it's easy to get truncated nsec
back and we get back better precision.

Note, we can further improve it later by removing the truncation and
maybe convincing net/ to use ktime/ns instead.

Signed-off-by: Pavel Begunkov <[email protected]>
Link: https://lore.kernel.org/r/95e7ec8d095069a3ed5d40a4bc6f8b586698bc7e.1722003776.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <[email protected]>
include/linux/io_uring_types.h
io_uring/io_uring.h
io_uring/napi.c
io_uring/napi.h
This page took 0.053653 seconds and 4 git commands to generate.