Change IORING_REGISTER_IOWQ_MAX_UNBOUND_WORKERS

This syncs with the kernel, it's now IORING_REGISTER_IOWQ_MAX_WORKERS
and can get/set the values for both bounded and unbounded workers.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2021-08-29 08:04:00 -06:00
parent ef99c9b910
commit 8295a41544
4 changed files with 19 additions and 16 deletions
+14 -11
View File
@@ -320,23 +320,26 @@ set.
Available since 5.14.
.TP
.B IORING_REGISTER_IOWQ_MAX_UNBOUND
.B IORING_REGISTER_IOWQ_MAX_WORKERS
By default, io_uring limits the unbounded workers created to the maximum
processor count set by
.I RLIMIT_NPROC.
Sometimes this can be excessive, and this command provides a way to limit
the count per ring (per NUMA node) instead.
.I RLIMIT_NPROC
and the bounded workers is a function of the SQ ring size and the number
of CPUs in the system. Sometimes this can be excessive (or too little, for
bounded), and this command provides a way to change the count per ring (per NUMA
node) instead.
.I arg
must be set to an
.I unsigned int
pointer, with the value in the variable being set to the maximum count of
unbounded workers per NUMA node. If the count being passed in is 0, then
this command returns the current maximum values. If any other values is set,
this command returns either the old value, or -1 and
.I errno
set appropriately.
pointer to an array of two values, with the values in the array being set to
the maximum count of workers per NUMA node. Index 0 holds the bounded worker
count, and index 1 holds the unbounded worker count. On successful return, the
passed in array will contain the previous maximum valyes for each type. If the
count being passed in is 0, then this command returns the current maximum values
and doesn't modify the current setting.
.I nr_args
must be set to 1, as the command only takes one argument.
must be set to 2, as the command takes two values.
Available since 5.15.
+2 -2
View File
@@ -161,8 +161,8 @@ int __io_uring_sqring_wait(struct io_uring *ring);
int io_uring_register_iowq_aff(struct io_uring *ring, size_t cpusz,
const cpu_set_t *mask);
int io_uring_unregister_iowq_aff(struct io_uring *ring);
int io_uring_unregister_iowq_max_unbound(struct io_uring *ring,
unsigned int value);
int io_uring_unregister_iowq_max_workers(struct io_uring *ring,
unsigned int *values);
/*
* Helper for the peek/wait single cqe functions. Exported because of that,
+1 -1
View File
@@ -42,5 +42,5 @@ LIBURING_2.1 {
io_uring_register_files_update_tag;
io_uring_register_iowq_aff;
io_uring_unregister_iowq_aff;
io_uring_register_iowq_max_unbound;
io_uring_register_iowq_max_workers;
} LIBURING_2.0;
+2 -2
View File
@@ -284,13 +284,13 @@ int io_uring_unregister_iowq_aff(struct io_uring *ring)
return ret;
}
int io_uring_register_iowq_max_unbound(struct io_uring *ring, unsigned int val)
int io_uring_register_iowq_max_workers(struct io_uring *ring, unsigned int *val)
{
int ret;
ret = __sys_io_uring_register(ring->ring_fd,
IORING_REGISTER_IOWQ_MAX_UNBOUND,
&val, 1);
val, 2);
if (ret < 0)
return -errno;