Patch "nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset" has been added to the 5.10-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

    nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset

to the 5.10-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:
     nvme-adjust-multiples-of-nvme_ctrl_page_size-in-offs.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 57fbfb680d8a5e3ef1bcec1c28b13871f7f50069
Author: Kundan Kumar <kundan.kumar@xxxxxxxxxxx>
Date:   Thu May 23 17:01:49 2024 +0530

    nvme: adjust multiples of NVME_CTRL_PAGE_SIZE in offset
    
    [ Upstream commit 1bd293fcf3af84674e82ed022c049491f3768840 ]
    
    bio_vec start offset may be relatively large particularly when large
    folio gets added to the bio. A bigger offset will result in avoiding the
    single-segment mapping optimization and end up using expensive
    mempool_alloc further.
    
    Rather than using absolute value, adjust bv_offset by
    NVME_CTRL_PAGE_SIZE while checking if segment can be fitted into one/two
    PRP entries.
    
    Suggested-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Kundan Kumar <kundan.kumar@xxxxxxxxxxx>
    Reviewed-by: Sagi Grimberg <sagi@xxxxxxxxxxx>
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Keith Busch <kbusch@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 5242feda5471a..a7131f4752e28 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -844,7 +844,8 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req,
 		struct bio_vec bv = req_bvec(req);
 
 		if (!is_pci_p2pdma_page(bv.bv_page)) {
-			if (bv.bv_offset + bv.bv_len <= NVME_CTRL_PAGE_SIZE * 2)
+			if ((bv.bv_offset & (NVME_CTRL_PAGE_SIZE - 1)) +
+			     bv.bv_len <= NVME_CTRL_PAGE_SIZE * 2)
 				return nvme_setup_prp_simple(dev, req,
 							     &cmnd->rw, &bv);
 




[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