Patch "block: cleanup and fix batch completion adding conditions" has been added to the 6.13-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

    block: cleanup and fix batch completion adding conditions

to the 6.13-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:
     block-cleanup-and-fix-batch-completion-adding-condit.patch
and it can be found in the queue-6.13 subdirectory.

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



commit b04b94397c64c9bba3eadc81145de658835e37f5
Author: Jens Axboe <axboe@xxxxxxxxx>
Date:   Thu Feb 13 08:18:46 2025 -0700

    block: cleanup and fix batch completion adding conditions
    
    [ Upstream commit 1f47ed294a2bd577d5ae43e6e28e1c9a3be4a833 ]
    
    The conditions for whether or not a request is allowed adding to a
    completion batch are a bit hard to read, and they also have a few
    issues. One is that ioerror may indeed be a random value on passthrough,
    and it's being checked unconditionally of whether or not the given
    request is a passthrough request or not.
    
    Rewrite the conditions to be separate for easier reading, and only check
    ioerror for non-passthrough requests. This fixes an issue with bio
    unmapping on passthrough, where it fails getting added to a batch. This
    both leads to suboptimal performance, and may trigger a potential
    schedule-under-atomic condition for polled passthrough IO.
    
    Fixes: f794f3351f26 ("block: add support for blk_mq_end_request_batch()")
    Link: https://lore.kernel.org/r/20575f0a-656e-4bb3-9d82-dec6c7e3a35c@xxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index c596e0e4cb751..7b19b83349cf8 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -872,12 +872,22 @@ static inline bool blk_mq_add_to_batch(struct request *req,
 				       void (*complete)(struct io_comp_batch *))
 {
 	/*
-	 * blk_mq_end_request_batch() can't end request allocated from
-	 * sched tags
+	 * Check various conditions that exclude batch processing:
+	 * 1) No batch container
+	 * 2) Has scheduler data attached
+	 * 3) Not a passthrough request and end_io set
+	 * 4) Not a passthrough request and an ioerror
 	 */
-	if (!iob || (req->rq_flags & RQF_SCHED_TAGS) || ioerror ||
-			(req->end_io && !blk_rq_is_passthrough(req)))
+	if (!iob)
 		return false;
+	if (req->rq_flags & RQF_SCHED_TAGS)
+		return false;
+	if (!blk_rq_is_passthrough(req)) {
+		if (req->end_io)
+			return false;
+		if (ioerror < 0)
+			return false;
+	}
 
 	if (!iob->complete)
 		iob->complete = complete;




[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