Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: re-arrange struct io_ring_ctx to reduce padding

Nothing major here, just moving a few things around to reduce the
padding. This reduces the size on a non-debug kernel from 1536 to
1472 bytes, saving a full cacheline.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+16 -15
+16 -15
include/linux/io_uring_types.h
··· 240 240 unsigned int poll_activated: 1; 241 241 unsigned int drain_disabled: 1; 242 242 unsigned int compat: 1; 243 + unsigned int iowq_limits_set : 1; 243 244 244 245 struct task_struct *submitter_task; 245 246 struct io_rings *rings; ··· 275 274 */ 276 275 struct io_rsrc_node *rsrc_node; 277 276 atomic_t cancel_seq; 277 + 278 + /* 279 + * ->iopoll_list is protected by the ctx->uring_lock for 280 + * io_uring instances that don't use IORING_SETUP_SQPOLL. 281 + * For SQPOLL, only the single threaded io_sq_thread() will 282 + * manipulate the list, hence no extra locking is needed there. 283 + */ 284 + bool poll_multi_queue; 285 + struct io_wq_work_list iopoll_list; 286 + 278 287 struct io_file_table file_table; 288 + struct io_mapped_ubuf **user_bufs; 279 289 unsigned nr_user_files; 280 290 unsigned nr_user_bufs; 281 - struct io_mapped_ubuf **user_bufs; 282 291 283 292 struct io_submit_state submit_state; 284 293 ··· 298 287 struct io_hash_table cancel_table_locked; 299 288 struct io_alloc_cache apoll_cache; 300 289 struct io_alloc_cache netmsg_cache; 301 - 302 - /* 303 - * ->iopoll_list is protected by the ctx->uring_lock for 304 - * io_uring instances that don't use IORING_SETUP_SQPOLL. 305 - * For SQPOLL, only the single threaded io_sq_thread() will 306 - * manipulate the list, hence no extra locking is needed there. 307 - */ 308 - struct io_wq_work_list iopoll_list; 309 - bool poll_multi_queue; 310 290 311 291 /* 312 292 * Any cancelable uring_cmd is added to this list in ··· 345 343 spinlock_t completion_lock; 346 344 347 345 /* IRQ completion list, under ->completion_lock */ 348 - struct io_wq_work_list locked_free_list; 349 346 unsigned int locked_free_nr; 347 + struct io_wq_work_list locked_free_list; 350 348 351 349 struct list_head io_buffers_comp; 352 350 struct list_head cq_overflow_list; ··· 368 366 unsigned int file_alloc_start; 369 367 unsigned int file_alloc_end; 370 368 371 - struct xarray personalities; 372 - u32 pers_next; 373 - 374 369 struct list_head io_buffers_cache; 375 370 376 371 /* deferred free list, protected by ->uring_lock */ ··· 388 389 struct wait_queue_head rsrc_quiesce_wq; 389 390 unsigned rsrc_quiesce; 390 391 392 + u32 pers_next; 393 + struct xarray personalities; 394 + 391 395 /* hashed buffered write serialization */ 392 396 struct io_wq_hash *hash_map; 393 397 ··· 407 405 408 406 /* io-wq management, e.g. thread count */ 409 407 u32 iowq_limits[2]; 410 - bool iowq_limits_set; 411 408 412 409 struct callback_head poll_wq_task_work; 413 410 struct list_head defer_list;