Patch "io_uring: adjust defer tw counting" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    io_uring: adjust defer tw counting

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     io_uring-adjust-defer-tw-counting.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5f79c202aba81ca8c13c828fdea51a268de33de8
Author: Pavel Begunkov <asml.silence@xxxxxxxxx>
Date:   Wed Jan 17 00:57:26 2024 +0000

    io_uring: adjust defer tw counting
    
    [ Upstream commit dc12d1799ce710fd90abbe0ced71e7e1ae0894fc ]
    
    The UINT_MAX work item counting bias in io_req_local_work_add() in case
    of !IOU_F_TWQ_LAZY_WAKE works in a sense that we will not miss a wake up,
    however it's still eerie. In particular, if we add a lazy work item
    after a non-lazy one, we'll increment it and get nr_tw==0, and
    subsequent adds may try to unnecessarily wake up the task, which is
    though not so likely to happen in real workloads.
    
    Half the bias, it's still large enough to be larger than any valid
    ->cq_wait_nr, which is limited by IORING_MAX_CQ_ENTRIES, but further
    have a good enough of space before it overflows.
    
    Fixes: 8751d15426a31 ("io_uring: reduce scheduling due to tw")
    Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
    Link: https://lore.kernel.org/r/108b971e958deaf7048342930c341ba90f75d806.1705438669.git.asml.silence@xxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 1cc4c7b05949..ea772a02c140 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1339,7 +1339,7 @@ static inline void io_req_local_work_add(struct io_kiocb *req, unsigned flags)
 		nr_tw = nr_tw_prev + 1;
 		/* Large enough to fail the nr_wait comparison below */
 		if (!(flags & IOU_F_TWQ_LAZY_WAKE))
-			nr_tw = -1U;
+			nr_tw = INT_MAX;
 
 		req->nr_tw = nr_tw;
 		req->io_task_work.node.next = first;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux