[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210913104101.GA29616@asgard.redhat.com>
Date: Mon, 13 Sep 2021 12:41:01 +0200
From: Eugene Syromiatnikov <esyr@...hat.com>
To: Jens Axboe <axboe@...nel.dk>,
Pavel Begunkov <asml.silence@...il.com>
Cc: io-uring@...r.kernel.org, linux-kernel@...r.kernel.org,
"Dmitry V. Levin" <ldv@...ace.io>, linux-api@...r.kernel.org
Subject: [PATCH v2] io-wq: expose IO_WQ_ACCT_* enumeration items to UAPI
These are used to index elements in the argument
of IORING_REGISTER_IOWQ_MAX_WORKERS io_uring_register command,
so they are to be exposed in UAPI.
Complements: 2e480058ddc21ec5 ("io-wq: provide a way to limit max number of workers")
Signed-off-by: Eugene Syromiatnikov <esyr@...hat.com>
---
v2:
- IO_WQ_ACCT_NR is no longer exposed directly in UAPI, per Jens Axboe's
suggestion.
v1: https://lore.kernel.org/lkml/20210912122411.GA27679@asgard.redhat.com/
---
fs/io-wq.c | 5 ++---
include/uapi/linux/io_uring.h | 8 ++++++++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/fs/io-wq.c b/fs/io-wq.c
index 6c55362..eb5162d 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -14,6 +14,7 @@
#include <linux/rculist_nulls.h>
#include <linux/cpu.h>
#include <linux/tracehook.h>
+#include <uapi/linux/io_uring.h>
#include "io-wq.h"
@@ -78,9 +79,7 @@ struct io_wqe_acct {
};
enum {
- IO_WQ_ACCT_BOUND,
- IO_WQ_ACCT_UNBOUND,
- IO_WQ_ACCT_NR,
+ IO_WQ_ACCT_NR = __IO_WQ_ACCT_MAX
};
/*
diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h
index 59ef351..dae1841 100644
--- a/include/uapi/linux/io_uring.h
+++ b/include/uapi/linux/io_uring.h
@@ -324,6 +324,14 @@ enum {
IORING_REGISTER_LAST
};
+/* io-wq worker limit categories */
+enum {
+ IO_WQ_ACCT_BOUND,
+ IO_WQ_ACCT_UNBOUND,
+
+ __IO_WQ_ACCT_MAX /* Non-UAPI */
+};
+
/* deprecated, see struct io_uring_rsrc_update */
struct io_uring_files_update {
__u32 offset;
--
2.1.4
Powered by blists - more mailing lists