History

io_uring: allow user configurable IO thread CPU affinity

io-wq defaults to per-node masks for IO workers. This works fine by default, but isn't particularly handy for workloads that prefer more specific affinities, for either performance or isolation reasons. This adds IORING_REGISTER_IOWQ_AFF that allows the user to pass in a CPU mask that is then applied to IO thread workers, and an IORING_UNREGISTER_IOWQ_AFF that simply resets the masks back to the default of per-node. Note that no care is given to existing IO threads, they will need to go through a reschedule before the affinity is correct if they are already running or sleeping.

Jens Axboe committed 5 years ago

Commit fe764211 parent 0e034964 files · +74 −0Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+4−0
@@ -306,6 +306,10 @@ enum { · 305 unmodified lines
306306 IORING_REGISTER_BUFFERS2 = 15,
307307 IORING_REGISTER_BUFFERS_UPDATE = 16,
308308
309+ /* set/clear io-wq thread affinities */
310+ IORING_REGISTER_IOWQ_AFF = 17,
311+ IORING_UNREGISTER_IOWQ_AFF = 18,
312+
309313 /* this goes last */
310314 IORING_REGISTER_LAST
311315 };