lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241217-isolcpus-io-queues-v4-4-5d355fbb1e14@kernel.org>
Date: Tue, 17 Dec 2024 19:29:38 +0100
From: Daniel Wagner <wagi@...nel.org>
To: Jens Axboe <axboe@...nel.dk>, Keith Busch <kbusch@...nel.org>, 
 Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>, 
 Kashyap Desai <kashyap.desai@...adcom.com>, 
 Sumit Saxena <sumit.saxena@...adcom.com>, 
 Shivasharan S <shivasharan.srikanteshwara@...adcom.com>, 
 Chandrakanth patil <chandrakanth.patil@...adcom.com>, 
 "Martin K. Petersen" <martin.petersen@...cle.com>, 
 Nilesh Javali <njavali@...vell.com>, GR-QLogic-Storage-Upstream@...vell.com, 
 Don Brace <don.brace@...rochip.com>, "Michael S. Tsirkin" <mst@...hat.com>, 
 Jason Wang <jasowang@...hat.com>, Paolo Bonzini <pbonzini@...hat.com>, 
 Stefan Hajnoczi <stefanha@...hat.com>, 
 Eugenio Pérez <eperezma@...hat.com>, 
 Xuan Zhuo <xuanzhuo@...ux.alibaba.com>, 
 Andrew Morton <akpm@...ux-foundation.org>, 
 Thomas Gleixner <tglx@...utronix.de>
Cc: Costa Shulyupin <costa.shul@...hat.com>, 
 Juri Lelli <juri.lelli@...hat.com>, 
 Valentin Schneider <vschneid@...hat.com>, Waiman Long <llong@...hat.com>, 
 Ming Lei <ming.lei@...hat.com>, 
 Michal Koutný <mkoutny@...e.com>, 
 Frederic Weisbecker <frederic@...nel.org>, Mel Gorman <mgorman@...e.de>, 
 Hannes Reinecke <hare@...e.de>, 
 Sridhar Balaraman <sbalaraman@...allelwireless.com>, 
 "brookxu.cn" <brookxu.cn@...il.com>, linux-kernel@...r.kernel.org, 
 linux-block@...r.kernel.org, linux-nvme@...ts.infradead.org, 
 megaraidlinux.pdl@...adcom.com, linux-scsi@...r.kernel.org, 
 storagedev@...rochip.com, virtualization@...ts.linux.dev, 
 Daniel Wagner <wagi@...nel.org>
Subject: [PATCH v4 4/9] nvme-pci: use block layer helpers to calculate num
 of queues

Multiqueue devices should only allocate queues for the housekeeping CPUs
when isolcpus=managed_irq is set. This avoids that the isolated CPUs get
disturbed with OS workload.

Use helpers which calculates the correct number of queues which should
be used when isolcpus is used.

Reviewed-by: Christoph Hellwig <hch@....de>
Signed-off-by: Daniel Wagner <wagi@...nel.org>
---
 drivers/nvme/host/pci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 709328a67f915aede5c6bae956e1bdd5e6f3f1bc..4af22f09ed8474676edd118477344ed32236c497 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -81,7 +81,7 @@ static int io_queue_count_set(const char *val, const struct kernel_param *kp)
 	int ret;
 
 	ret = kstrtouint(val, 10, &n);
-	if (ret != 0 || n > num_possible_cpus())
+	if (ret != 0 || n > blk_mq_num_possible_queues(0))
 		return -EINVAL;
 	return param_set_uint(val, kp);
 }
@@ -2439,7 +2439,8 @@ static unsigned int nvme_max_io_queues(struct nvme_dev *dev)
 	 */
 	if (dev->ctrl.quirks & NVME_QUIRK_SHARED_TAGS)
 		return 1;
-	return num_possible_cpus() + dev->nr_write_queues + dev->nr_poll_queues;
+	return blk_mq_num_possible_queues(0) + dev->nr_write_queues +
+		dev->nr_poll_queues;
 }
 
 static int nvme_setup_io_queues(struct nvme_dev *dev)

-- 
2.47.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ