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: <87ldkack1o.ffs@tglx>
Date: Thu, 13 Nov 2025 11:18:43 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Luigi Rizzo <lrizzo@...gle.com>, Marc Zyngier <maz@...nel.org>, Luigi
 Rizzo <rizzo.unipi@...il.com>, Paolo Abeni <pabeni@...hat.com>, Andrew
 Morton <akpm@...ux-foundation.org>, Sean Christopherson
 <seanjc@...gle.com>, Jacob Pan <jacob.jun.pan@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org, Bjorn Helgaas
 <bhelgaas@...gle.com>, Willem de Bruijn <willemb@...gle.com>, Luigi Rizzo
 <lrizzo@...gle.com>
Subject: Re: [PATCH 6/6] genirq: soft_moderation: implement per-driver
 defaults (nvme and vfio)

On Wed, Nov 12 2025 at 19:24, Luigi Rizzo wrote:
> Introduce helpers to implement per-driver module parameters to enable
> moderation at boot/probe time.
>
> As an example, use the helpers in nvme and vfio drivers.
>
> To test, boot a kernel with
>
> ${driver}.soft_moderation=1 # enables moderation.
>
> and verify with "cat /proc/irq/soft_moderation" that
> the counters increase.
>
> Change-Id: Iaad4110977deb96df845501895e0043bd93fc350
> ---
>  drivers/nvme/host/pci.c           |  3 +++
>  drivers/vfio/pci/vfio_pci_intrs.c |  3 +++
>  include/linux/interrupt.h         | 13 +++++++++++++
>  kernel/irq/irq_moderation.c       | 11 +++++++++++

Again a pile of randomly picked files. The proper way is documented:

   1) Add infrastructure first

   2) Use infrastructure in drivers, one patch per subsystem

> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 72fb675a696f4..b9d7bce30061f 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -72,6 +72,8 @@
>  static_assert(MAX_PRP_RANGE / NVME_CTRL_PAGE_SIZE <=
>  	(1 /* prp1 */ + NVME_MAX_NR_DESCRIPTORS * PRPS_PER_PAGE));
>  
> +DEFINE_IRQ_MODERATION_MODE_PARAMETER;
> +
>  static int use_threaded_interrupts;
>  module_param(use_threaded_interrupts, int, 0444);
>  
> @@ -1989,6 +1991,7 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid, bool polled)
>  		result = queue_request_irq(nvmeq);
>  		if (result < 0)
>  			goto release_sq;
> +		IRQ_MODERATION_SET_DEFAULT_MODE(pci_irq_vector(to_pci_dev(dev->dev), vector));

What's the point of this IRQ_MODERATION_SET_DEFAULT_MODE() wrapper?

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ