Message ID | 20250424-isolcpus-io-queues-v6-3-9a53a870ca1f@kernel.org |
---|---|
State | New |
Headers | show |
Series | blk: honor isolcpus configuration | expand |
On Thu, Apr 24, 2025 at 08:19:42PM +0200, Daniel Wagner wrote: > Multiqueue devices should only allocate queues for the housekeeping CPUs > when isolcpus=io_queue is set. This avoids that the isolated CPUs get > disturbed with OS workload. The commit log needs to be updated: - io_queue isn't introduced yet - this patch can only reduce nr_hw_queues, and queue mapping isn't changed yet, so nothing to do with "This avoids that the isolated CPUs get disturbed with OS workload" Thanks, Ming
On Fri, May 09, 2025 at 09:47:31AM +0800, Ming Lei wrote: > On Thu, Apr 24, 2025 at 08:19:42PM +0200, Daniel Wagner wrote: > > Multiqueue devices should only allocate queues for the housekeeping CPUs > > when isolcpus=io_queue is set. This avoids that the isolated CPUs get > > disturbed with OS workload. > > The commit log needs to be updated: > > - io_queue isn't introduced yet > > - this patch can only reduce nr_hw_queues, and queue mapping isn't changed > yet, so nothing to do with > > "This avoids that the isolated CPUs get disturbed with OS workload" What about: The calculation of the upper limit for queues does not depend solely on the number of possible CPUs; for example, the isolcpus kernel command-line option must also be considered. To account for this, the block layer provides a helper function to retrieve the maximum number of queues. Use it to set an appropriate upper queue number limit. I would use this version for the other patches as well, s/possible/online/ where necessary.
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index b178d52eac1b7f7286e217226b9b3686d07b7b6c..2b1aa6833a12a5ecf7b293461a115026f97ea94c 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); } @@ -2448,7 +2448,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)