From: Keith Busch Date: Fri, 13 May 2016 18:38:09 +0000 (-0600) Subject: NVMe: Allocate queues only for online cpus X-Git-Tag: v4.1.12-110.0.20170822_0730~33 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bbd2807b98676a9d79f003b42ec39e554efe32f8;p=users%2Fjedix%2Flinux-maple.git NVMe: Allocate queues only for online cpus The driver previously requested allocating queues for the total possible number of CPUs so that blk-mq could rebalance these if CPUs were added after initialization. The number of hardware contexts can now be changed at runtime, so we only need to allocate the number of online queues since we can add more later. Suggested-by: Jeff Lien Signed-off-by: Keith Busch Reviewed-by: Johannes Thumshirn Signed-off-by: Jens Axboe Orabug: 24675382 (cherry picked from commit 2800b8e7d9dfca1fd9d044dcf7a046b5de5a7239) Signed-off-by: Kyle Fortin Conflicts: drivers/nvme/host/pci.c Reviewed-by: Govinda Tatti Reviewed-by: Bhavesh Davda Reviewed-by: Martin K. Petersen --- diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 1b27e954fd43..75956a0a5d0a 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1413,7 +1413,7 @@ static int nvme_setup_io_queues(struct nvme_dev *dev) struct pci_dev *pdev = to_pci_dev(dev->dev); int result, i, vecs, nr_io_queues, size; - nr_io_queues = min(nvme_io_queues, num_possible_cpus()); + nr_io_queues = min(nvme_io_queues, num_online_cpus()); result = nvme_set_queue_count(&dev->ctrl, &nr_io_queues); if (result < 0) return result;