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.

Merge tag 'io_uring-6.7-2023-12-15' of git://git.kernel.dk/linux

Pull io_uring fixes from Jens Axboe:
"Just two minor fixes:

- Fix for the io_uring socket option commands using the wrong value
on some archs (Al)

- Tweak to the poll lazy wake enable (me)"

* tag 'io_uring-6.7-2023-12-15' of git://git.kernel.dk/linux:
io_uring/cmd: fix breakage in SOCKET_URING_OP_SIOC* implementation
io_uring/poll: don't enable lazy wake for POLLEXCLUSIVE

+21 -4
+3
include/linux/io_uring_types.h
··· 434 434 /* keep async read/write and isreg together and in order */ 435 435 REQ_F_SUPPORT_NOWAIT_BIT, 436 436 REQ_F_ISREG_BIT, 437 + REQ_F_POLL_NO_LAZY_BIT, 437 438 438 439 /* not a real bit, just to check we're not overflowing the space */ 439 440 __REQ_F_LAST_BIT, ··· 502 501 REQ_F_CLEAR_POLLIN = BIT(REQ_F_CLEAR_POLLIN_BIT), 503 502 /* hashed into ->cancel_hash_locked, protected by ->uring_lock */ 504 503 REQ_F_HASH_LOCKED = BIT(REQ_F_HASH_LOCKED_BIT), 504 + /* don't use lazy poll wake for this request */ 505 + REQ_F_POLL_NO_LAZY = BIT(REQ_F_POLL_NO_LAZY_BIT), 505 506 }; 506 507 507 508 typedef void (*io_req_tw_func_t)(struct io_kiocb *req, struct io_tw_state *ts);
+17 -3
io_uring/poll.c
··· 366 366 367 367 static void __io_poll_execute(struct io_kiocb *req, int mask) 368 368 { 369 + unsigned flags = 0; 370 + 369 371 io_req_set_res(req, mask, 0); 370 372 req->io_task_work.func = io_poll_task_func; 371 373 372 374 trace_io_uring_task_add(req, mask); 373 - __io_req_task_work_add(req, IOU_F_TWQ_LAZY_WAKE); 375 + 376 + if (!(req->flags & REQ_F_POLL_NO_LAZY)) 377 + flags = IOU_F_TWQ_LAZY_WAKE; 378 + __io_req_task_work_add(req, flags); 374 379 } 375 380 376 381 static inline void io_poll_execute(struct io_kiocb *req, int res) ··· 531 526 poll->head = head; 532 527 poll->wait.private = (void *) wqe_private; 533 528 534 - if (poll->events & EPOLLEXCLUSIVE) 529 + if (poll->events & EPOLLEXCLUSIVE) { 530 + /* 531 + * Exclusive waits may only wake a limited amount of entries 532 + * rather than all of them, this may interfere with lazy 533 + * wake if someone does wait(events > 1). Ensure we don't do 534 + * lazy wake for those, as we need to process each one as they 535 + * come in. 536 + */ 537 + req->flags |= REQ_F_POLL_NO_LAZY; 535 538 add_wait_queue_exclusive(head, &poll->wait); 536 - else 539 + } else { 537 540 add_wait_queue(head, &poll->wait); 541 + } 538 542 } 539 543 540 544 static void io_poll_queue_proc(struct file *file, struct wait_queue_head *head,
+1 -1
io_uring/uring_cmd.c
··· 7 7 #include <linux/nospec.h> 8 8 9 9 #include <uapi/linux/io_uring.h> 10 - #include <uapi/asm-generic/ioctls.h> 10 + #include <asm/ioctls.h> 11 11 12 12 #include "io_uring.h" 13 13 #include "rsrc.h"