Commit 22eb2a3f authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

io_uring: refactor ctx slow data placement



Shove all slow path data at the end of ctx and get rid of extra
indention.

Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/bcaf200298dd469af20787650550efc66d89bef2.1655310733.git.asml.silence@gmail.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent aff5b2df
Loading
Loading
Loading
Loading
+39 −42
Original line number Diff line number Diff line
@@ -185,7 +185,6 @@ struct io_ring_ctx {
		struct list_head	apoll_cache;
		struct xarray		personalities;
		u32			pers_next;
		unsigned		sq_thread_idle;
	} ____cacheline_aligned_in_smp;

	/* IRQ completion list, under ->completion_lock */
@@ -232,10 +231,20 @@ struct io_ring_ctx {
		struct list_head	io_buffers_comp;
	} ____cacheline_aligned_in_smp;

	/* timeouts */
	struct {
		spinlock_t		timeout_lock;
		atomic_t		cq_timeouts;
		struct list_head	timeout_list;
		struct list_head	ltimeout_list;
		unsigned		cq_last_tm_flush;
	} ____cacheline_aligned_in_smp;

	/* Keep this last, we don't need it for the fast path */

	struct io_restriction		restrictions;

	/* slow path rsrc auxilary data, used by update/register */
	struct {
	struct io_rsrc_node		*rsrc_backup_node;
	struct io_mapped_ubuf		*dummy_ubuf;
	struct io_rsrc_data		*file_data;
@@ -247,19 +256,7 @@ struct io_ring_ctx {
	spinlock_t			rsrc_ref_lock;

	struct list_head		io_buffers_pages;
	};

	/* timeouts */
	struct {
		spinlock_t		timeout_lock;
		atomic_t		cq_timeouts;
		struct list_head	timeout_list;
		struct list_head	ltimeout_list;
		unsigned		cq_last_tm_flush;
	} ____cacheline_aligned_in_smp;

	/* Keep this last, we don't need it for the fast path */
	struct {
	#if defined(CONFIG_UNIX)
		struct socket		*ring_sock;
	#endif
@@ -282,7 +279,7 @@ struct io_ring_ctx {
	bool				iowq_limits_set;

	struct list_head		defer_list;
	};
	unsigned			sq_thread_idle;
};

enum {