io_uring: remove structures from include/linux/io_uring.h
PATCH v2 1/2 io_uring: remove structures from include/linux/io_uring.h
In reply to a message not in the archive--- fs/io-wq.h | 10 +++++++++- fs/io_uring.c | 16 ++++++++++++++++ include/linux/io_uring.h | 25 ------------------------- 3 files changed, 25 insertions(+), 26 deletions(-)
fs/io-wq.h +0 -1
@@ -2,7 +2,6 @@#define INTERNAL_IO_WQ_H #include <linux/refcount.h> -#include <linux/io_uring.h> struct io_wq ; @@ -21,6 +20,15 @@ enum io_wq_cancel {IO_WQ_CANCEL_NOTFOUND ,/* work not found */ };
+struct io_wq_work_node {
+ struct io_wq_work_node *next;
+};
+
+struct io_wq_work_list {
+ struct io_wq_work_node *first;
+ struct io_wq_work_node *last;
+};
+
static inline void wq_list_add_after(struct io_wq_work_node *node,
struct io_wq_work_node *pos, struct io_wq_work_list *list)
fs/io_uring.c +15 -0
@@ -454,6 +454,22 @@ struct io_ring_ctx {struct list_head tctx_list; }; +struct io_uring_task { +/* submission side */ +struct xarray xa; +struct wait_queue_head wait; +void *last; +void *io_wq; +struct percpu_counter inflight; +atomic_t in_idle; +bool sqpoll; + +spinlock_t task_lock; +struct io_wq_work_list task_list; +unsigned long task_state; +struct callback_head task_work; +}; +/* * First field must be the file pointer in all the * iocb unions! See also 'struct kiocb' in <linux/fs.h>
include/linux/io_uring.h +0 -24
@@ -5,31 +5,6 @@#include <linux/sched.h> #include <linux/xarray.h> -struct io_wq_work_node { -struct io_wq_work_node *next; -}; - -struct io_wq_work_list { -struct io_wq_work_node *first; -struct io_wq_work_node *last; -}; - -struct io_uring_task { -/* submission side */ -struct xarray xa; -struct wait_queue_head wait; -void *last; -void *io_wq; -struct percpu_counter inflight; -atomic_t in_idle; -bool sqpoll; - -spinlock_t task_lock; -struct io_wq_work_list task_list; -unsigned long task_state; -struct callback_head task_work; -}; -#if defined(CONFIG_IO_URING )struct sock *io_uring_get_socket (struct file *file);void __io_uring_task_cancel (void );
Signature · 1 line
2.25.1
PATCH v2 2/2 io_uring: use typesafe pointers in io_uring_task
In reply to a message not in the archive--- fs/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/io_uring.c +2 -2
@@ -458,8 +458,8 @@ struct io_uring_task {/* submission side */ struct xarray xa;struct wait_queue_head wait; -void *last; -void *io_wq; +const struct io_ring_ctx *last; +struct io_wq *io_wq;struct percpu_counter inflight;atomic_t in_idle;bool sqpoll;
Signature · 1 line
2.25.1
Both patches are really nice. However, 1/2 doesn't apply and looks it needs small stylistic changes, see nits below
Quoted 11 lines · Stefan Metzmacher
--- fs/io-wq.h | 10 +++++++++- fs/io_uring.c | 16 ++++++++++++++++ include/linux/io_uring.h | 25 ------------------------- 3 files changed, 25 insertions(+), 26 deletions(-)fs/io-wq.h +0
-0
fs/io-wq.h line 7
Quoted 7 lines
fs/io-wq.h +0
-1@@ -2,7 +2,6 @@#define INTERNAL_IO_WQ_H #include <linux/refcount.h> -#include <linux/io_uring.h> struct io_wq ; @@ -21,6 +20,15 @@ enum io_wq_cancel {IO_WQ_CANCEL_NOTFOUND ,/* work not found */ };
newline (nl)?
Quoted 17 lines
+struct
io_wq_work_node{fs/io-wq.h +8
-0+struct io_wq_work_node *next; +}; + +struct io_wq_work_list { +struct io_wq_work_node *first; +struct io_wq_work_node *last; +}; +static inline void wq_list_add_after (struct io_wq_work_node *node,struct io_wq_work_node *pos,struct io_wq_work_list *list)fs/io_uring.c +0
-0
fs/io_uring.c struct io_ring_ctx { · line 455
Quoted 2 lines
fs/io_uring.c +0
-0@@ -454,6 +454,22 @@ struct io_ring_ctx {struct list_head tctx_list; };
nl
Quoted 41 lines
fs/io_uring.c +15
-0+struct io_uring_task { +/* submission side */ +struct xarray xa; +struct wait_queue_head wait; +void *last; +void *io_wq; +struct percpu_counter inflight; +atomic_t in_idle; +bool sqpoll; + +spinlock_t task_lock; +struct io_wq_work_list task_list; +unsigned long task_state; +struct callback_head task_work; +}; +/* * First field must be the file pointer in all the * iocb unions! See also 'struct kiocb' in <linux/fs.h> include/linux/io_uring.h +0
-14@@ -5,31 +5,6 @@#include <linux/sched.h> #include <linux/xarray.h> -struct io_wq_work_node { -struct io_wq_work_node *next; -}; - -struct io_wq_work_list { -struct io_wq_work_node *first; -struct io_wq_work_node *last; -}; - -struct io_uring_task { -/* submission side */ -struct xarray xa; -struct wait_queue_head wait; -void *last; -void *io_wq;
include/linux/io_uring.h line 31
Quoted 10 lines
include/linux/io_uring.h +0
-10-struct percpu_counter inflight; -atomic_t in_idle; -bool sqpoll; - -spinlock_t task_lock; -struct io_wq_work_list task_list; -unsigned long task_state; -struct callback_head task_work; -}; -
nl
Quoted 4 lines
include/linux/io_uring.h +0
-0#if defined(CONFIG_IO_URING )struct sock *io_uring_get_socket (struct file *file);void __io_uring_task_cancel (void );
Signature · 1 line
Pavel Begunkov
Hi Pavel,
Quoted 2 lines
Both patches are really nice. However, 1/2 doesn't apply and looks it needs small stylistic changes, see nits below
It seems the mails got corrupted, I played with git imap-send... :-(
Here a branch with the patches:
https://git.samba.org/?p=metze/linux/wip.git;a=shortlog;h=refs/heads/io_uring-5.12
Should I resend them once I fixed my mail setup?
metze
Quoted 11 lines · Stefan Metzmacher
Hi Pavel,
Quoted 2 lines
Both patches are really nice. However, 1/2 doesn't apply and looks it needs small stylistic changes, see nits below
It seems the mails got corrupted, I played with git imap-send... :-(
Here a branch with the patches:
https://git.samba.org/?p=metze/linux/wip.git;a=shortlog;h=refs/heads/io_uring-5.12Should I resend them once I fixed my mail setup?
Who knows. Jens, do you want to take it for 5.12?
I just recently converted tctx->last from file* to ctx* and had to gaze enough to not screw, in this light 2/2 looks good from the safety perspective.
Signature · 1 line
Pavel Begunkov
v2 cover Some header cleanups
In reply to Stefan MetzmacherHi,
here're a few cleanups in order to make structures as private and typesafe as possible. It also cleans up the layering from io_uring.c being on top of io-wq.*.
Changes since v1:
- None, hopefully correct patch format now.
Stefan Metzmacher (2):
io_uring: remove structures from include/linux/io_uring.h
io_uring: use typesafe pointers in io_uring_task
fs/io-wq.h | 10 +++++++++- fs/io_uring.c | 16 ++++++++++++++++ include/linux/io_uring.h | 25 ------------------------- 3 files changed, 25 insertions(+), 26 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/2 io_uring: remove structures from include/linux/io_uring.h
--- fs/io-wq.h | 10 +++++++++- fs/io_uring.c | 16 ++++++++++++++++ include/linux/io_uring.h | 25 ------------------------- 3 files changed, 25 insertions(+), 26 deletions(-)
fs/io-wq.h +9 -1
@@ -2,7 +2,6 @@#define INTERNAL_IO_WQ_H #include <linux/refcount.h> -#include <linux/io_uring.h> struct io_wq ;
@@ -21,6 +20,15 @@ enum io_wq_cancel { IO_WQ_CANCEL_NOTFOUND, /* work not found */ }; +struct io_wq_work_node { +struct io_wq_work_node *next; +}; + +struct io_wq_work_list { +struct io_wq_work_node *first; +struct io_wq_work_node *last; +}; +static inline void wq_list_add_after (struct io_wq_work_node *node,struct io_wq_work_node *pos,struct io_wq_work_list *list)
fs/io_uring.c +16 -0
@@ -454,6 +454,22 @@ struct io_ring_ctx {struct list_head tctx_list; }; +struct io_uring_task { +/* submission side */ +struct xarray xa; +struct wait_queue_head wait; +void *last; +void *io_wq; +struct percpu_counter inflight; +atomic_t in_idle; +bool sqpoll; + +spinlock_t task_lock; +struct io_wq_work_list task_list; +unsigned long task_state; +struct callback_head task_work; +}; +/* * First field must be the file pointer in all the * iocb unions! See also 'struct kiocb' in <linux/fs.h>
include/linux/io_uring.h +0 -25
@@ -5,31 +5,6 @@#include <linux/sched.h> #include <linux/xarray.h> -struct io_wq_work_node { -struct io_wq_work_node *next; -}; - -struct io_wq_work_list { -struct io_wq_work_node *first; -struct io_wq_work_node *last; -}; - -struct io_uring_task { -/* submission side */ -struct xarray xa; -struct wait_queue_head wait; -void *last; -void *io_wq; -struct percpu_counter inflight; -atomic_t in_idle; -bool sqpoll; - -spinlock_t task_lock; -struct io_wq_work_list task_list; -unsigned long task_state; -struct callback_head task_work; -}; -#if defined(CONFIG_IO_URING )struct sock *io_uring_get_socket (struct file *file);void __io_uring_task_cancel (void );
Signature · 1 line
2.25.1
PATCH v2 2/2 io_uring: use typesafe pointers in io_uring_task
In reply to Stefan Metzmacher--- fs/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/io_uring.c +2 -2
@@ -458,8 +458,8 @@ struct io_uring_task {/* submission side */ struct xarray xa;struct wait_queue_head wait; -void *last; -void *io_wq; +const struct io_ring_ctx *last; +struct io_wq *io_wq;struct percpu_counter inflight;atomic_t in_idle;bool sqpoll;
Signature · 1 line
2.25.1
Jens Axboe
maintainerQuoted 11 lines · Pavel Begunkov
Quoted 10 lines · Stefan Metzmacher
Hi Pavel,
Quoted 2 lines
Both patches are really nice. However, 1/2 doesn't apply and looks it needs small stylistic changes, see nits below
It seems the mails got corrupted, I played with git imap-send... :-(
Here a branch with the patches:
https://git.samba.org/?p=metze/linux/wip.git;a=shortlog;h=refs/heads/io_uring-5.12
Quoted 6 lines
Quoted 1 line
Should I resend them once I fixed my mail setup?
Who knows. Jens, do you want to take it for 5.12?
I just recently converted
tctx->lastfrom file* to ctx* and had to gaze enough to not screw, in this light 2/2 looks good from the safety perspective.
Let's do them for 5.12 - Stefan, can you resend please?
Signature · 1 line
Jens Axboe
Jens Axboe
maintainerRe: [PATCH v2 0/2] Some header cleanups
In reply to Stefan MetzmacherQuoted 9 lines · Stefan Metzmacher
Hi,
here're a few cleanups in order to make structures as private and typesafe as possible. It also cleans up the layering from
io_uring.cbeing on top of io-wq.*.Changes since v1:
- None, hopefully correct patch format now.
And I see you already did resend, thanks I'll take them for 5.12.
Signature · 1 line
Jens Axboe