Skip to contentSkip to conversation

Patch "nvme-pci: use appropriate initial chunk size for HMB allocation" has been added to the 4.13-stable tree

PATCH [email protected] 1 participant 1 message Sep 28, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

nvme-pci: use appropriate initial chunk size for HMB allocation

to the 4.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:
nvme-pci-use-appropriate-initial-chunk-size-for-hmb-allocation.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 30f92d62e5b41a94de2d0bbd677a6ea2fcfed74f Mon Sep 17 00:00:00 2001

From: Akinobu Mita <[email protected]>
Date: Wed, 6 Sep 2017 12:15:31 +0200
Subject: nvme-pci: use appropriate initial chunk size for HMB allocation

From: Akinobu Mita <[email protected]>

commit 30f92d62e5b41a94de2d0bbd677a6ea2fcfed74f upstream.

The initial chunk size for host memory buffer allocation is currently PAGE_SIZE << MAX_ORDER. MAX_ORDER order allocation is usually failed without CONFIG_DMA_CMA. So the HMB allocation is retried with chunk size PAGE_SIZE << (MAX_ORDER - 1) in general, but there is no problem if the retry allocation works correctly.

---
 drivers/nvme/host/pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/pci.c +1 -1
@@ -1677,7 +1677,7 @@ static int nvme_alloc_host_mem(struct nv
 	u32 chunk_size;
 
 	/* start big and work our way down */
-	for (chunk_size = min_t(u64, preferred, PAGE_SIZE << MAX_ORDER);
+	for (chunk_size = min_t(u64, preferred, PAGE_SIZE * MAX_ORDER_NR_PAGES);
 	     chunk_size >= PAGE_SIZE * 2;
 	     chunk_size /= 2) {
 		if (!__nvme_alloc_host_mem(dev, preferred, chunk_size)) {

Patches currently in stable-queue which might be from [email protected] are

queue-4.13/nvme-pci-use-appropriate-initial-chunk-size-for-hmb-allocation.patch queue-4.13/nvme-pci-fix-host-memory-buffer-allocation-fallback.patch