History

Merge tag 'fuse-update-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

Pull fuse updates from Miklos Szeredi: "Add support for io-uring communication between kernel and userspace using IORING_OP_URING_CMD (Bernd Schubert). Following features enable gains in performance compared to the regular interface: - Allow processing multiple requests with less syscall overhead - Combine commit of old and fetch of new fuse request - CPU/NUMA affinity of queues Patches were reviewed by several people, including Pavel Begunkov, io-uring co-maintainer" * tag 'fuse-update-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: prevent disabling io-uring on active connections fuse: enable fuse-over-io-uring fuse: block request allocation until io-uring init is complete fuse: {io-uring} Prevent mount point hang on fuse-server termination fuse: Allow to queue bg requests through io-uring fuse: Allow to queue fg requests through io-uring fuse: {io-uring} Make fuse_dev_queue_{interrupt,forget} non-static fuse: {io-uring} Handle teardown of ring entries fuse: Add io-uring sqe commit and fetch support fuse: {io-uring} Make hash-list req unique finding functions non-static fuse: Add fuse-io-uring handling into fuse_copy fuse: Make fuse_copy non static fuse: {io-uring} Handle SQEs - register commands fuse: make args->in_args[0] to be always the header fuse: Add fuse-io-uring design documentation fuse: Move request bits fuse: Move fuse_get_dev to header file fuse: rename to fuse_dev_end_requests and make non-static

Linus Torvalds committed 1 year ago

Commit 92cc9ac2 parents 27560b3 2d4fde514 files · +1924 −78Browse files

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

Unified · Split

include/uapi/linux/fuse.h+75−1
@@ -220,6 +220,15 @@ · 219 unmodified lines
220220 *
221221 * 7.41
222222 * - add FUSE_ALLOW_IDMAP
223+ * 7.42
224+ * - Add FUSE_OVER_IO_URING and all other io-uring related flags and data
225+ * structures:
226+ * - struct fuse_uring_ent_in_out
227+ * - struct fuse_uring_req_header
228+ * - struct fuse_uring_cmd_req
229+ * - FUSE_URING_IN_OUT_HEADER_SZ
230+ * - FUSE_URING_OP_IN_OUT_SZ
231+ * - enum fuse_uring_cmd
223232 */
224233
225234 #ifndef _LINUX_FUSE_H
@@ -255,7 +264,7 @@ · 29 unmodified lines
255264 #define FUSE_KERNEL_VERSION 7
256265
257266 /** Minor version number of this interface */
258−#define FUSE_KERNEL_MINOR_VERSION 41
267+#define FUSE_KERNEL_MINOR_VERSION 42
259268
260269 /** The node ID of the root inode */
261270 #define FUSE_ROOT_ID 1
@@ -425,6 +434,7 @@ struct fuse_file_lock { · 163 unmodified lines
425434 * FUSE_HAS_RESEND: kernel supports resending pending requests, and the high bit
426435 * of the request ID indicates resend requests
427436 * FUSE_ALLOW_IDMAP: allow creation of idmapped mounts
437+ * FUSE_OVER_IO_URING: Indicate that client supports io-uring
428438 */
429439 #define FUSE_ASYNC_READ (1 << 0)
430440 #define FUSE_POSIX_LOCKS (1 << 1)
@@ -471,6 +481,7 @@ struct fuse_file_lock { · 40 unmodified lines
471481 /* Obsolete alias for FUSE_DIRECT_IO_ALLOW_MMAP */
472482 #define FUSE_DIRECT_IO_RELAX FUSE_DIRECT_IO_ALLOW_MMAP
473483 #define FUSE_ALLOW_IDMAP (1ULL << 40)
484+#define FUSE_OVER_IO_URING (1ULL << 41)
474485
475486 /**
476487 * CUSE INIT request/reply flags
@@ -1206,4 +1217,67 @@ struct fuse_supp_groups { · 729 unmodified lines
12061217 uint32_t groups[];
12071218 };
12081219
1220+/**
1221+ * Size of the ring buffer header
1222+ */
1223+#define FUSE_URING_IN_OUT_HEADER_SZ 128
1224+#define FUSE_URING_OP_IN_OUT_SZ 128
1225+
1226+/* Used as part of the fuse_uring_req_header */
1227+struct fuse_uring_ent_in_out {
1228+ uint64_t flags;
1229+
1230+ /*
1231+ * commit ID to be used in a reply to a ring request (see also
1232+ * struct fuse_uring_cmd_req)
1233+ */
1234+ uint64_t commit_id;
1235+
1236+ /* size of user payload buffer */
1237+ uint32_t payload_sz;
1238+ uint32_t padding;
1239+
1240+ uint64_t reserved;
1241+};
1242+
1243+/**
1244+ * Header for all fuse-io-uring requests
1245+ */
1246+struct fuse_uring_req_header {
1247+ /* struct fuse_in_header / struct fuse_out_header */
1248+ char in_out[FUSE_URING_IN_OUT_HEADER_SZ];
1249+
1250+ /* per op code header */
1251+ char op_in[FUSE_URING_OP_IN_OUT_SZ];
1252+
1253+ struct fuse_uring_ent_in_out ring_ent_in_out;
1254+};
1255+
1256+/**
1257+ * sqe commands to the kernel
1258+ */
1259+enum fuse_uring_cmd {
1260+ FUSE_IO_URING_CMD_INVALID = 0,
1261+
1262+ /* register the request buffer and fetch a fuse request */
1263+ FUSE_IO_URING_CMD_REGISTER = 1,
1264+
1265+ /* commit fuse request result and fetch next request */
1266+ FUSE_IO_URING_CMD_COMMIT_AND_FETCH = 2,
1267+};
1268+
1269+/**
1270+ * In the 80B command area of the SQE.
1271+ */
1272+struct fuse_uring_cmd_req {
1273+ uint64_t flags;
1274+
1275+ /* entry identifier for commits */
1276+ uint64_t commit_id;
1277+
1278+ /* queue the command is for (queue index) */
1279+ uint16_t qid;
1280+ uint8_t padding[6];
1281+};
1282+
12091283 #endif /* _LINUX_FUSE_H */