[RFC PATCH] nvme-pci: adaptively poll completions on busy queues

Keith Busch kbusch at kernel.org
Thu Jul 23 07:46:21 PDT 2026


On Thu, Jul 23, 2026 at 08:05:56PM +0800, Fengnan Chang wrote:
> +static void nvme_adaptive_mask_irq(struct nvme_queue *nvmeq, int irq)
> +{
> +	struct nvme_dev *dev = nvmeq->dev;
> +	struct pci_dev *pdev = to_pci_dev(dev->dev);
> +
> +	if (pdev->msi_enabled) {
> +		writel(BIT(nvmeq->cq_vector), dev->bar + NVME_REG_INTMS);
> +		readl(dev->bar + NVME_REG_INTMS);

Why do you have the readl? That's not necesary.

> +	} else {
> +		disable_irq_nosync(irq);
> +	}
> +}
> +
> +static void nvme_adaptive_unmask_irq(struct nvme_queue *nvmeq, int irq)
> +{
> +	struct nvme_dev *dev = nvmeq->dev;
> +	struct pci_dev *pdev = to_pci_dev(dev->dev);
> +
> +	clear_bit(NVMEQ_ADAPTIVE_POLLING, &nvmeq->flags);
> +	if (pdev->msi_enabled) {
> +		writel(BIT(nvmeq->cq_vector), dev->bar + NVME_REG_INTMC);
> +		readl(dev->bar + NVME_REG_INTMS);

Same here.



More information about the Linux-nvme mailing list