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: <CAMOZA0+nKMvN_u7Di=2ODcMYgfyLXfHtvN1uDy3YdMR-kh5c1A@mail.gmail.com>
Date: Thu, 13 Nov 2025 15:55:55 +0100
From: Luigi Rizzo <lrizzo@...gle.com>
To: Marc Zyngier <maz@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>, 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>, 
	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org, 
	Bjorn Helgaas <bhelgaas@...gle.com>, Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH 1/6] genirq: platform wide interrupt moderation:
 Documentation, Kconfig, irq_desc

On Thu, Nov 13, 2025 at 3:42 PM Marc Zyngier <maz@...nel.org> wrote:
> [...]

>
> The descriptions are also massively x86-specific. That's probably OK
> for the stuff you care about, but I'd certainly would want things to
> be a bit more abstract and applicable to all architectures.

Absolutely.

> I also note that since you explicitly check for handle_edge_irq() in
> set_moderation_mode(), this will not work on anything GIC related, or
> any other architecture that uses the fasteoi flows. I really wonder
> why you are not looking at the actual trigger mode instead...

sure, that would be the best thing. Any suggestions on how to fix the
check ?

>
> Until you fix it, please refrain from touching the GICv3 code, and
> make sure this is solely enabled on x86 -- it clearly wasn't tested on
> anything else.

FWIW I did verify correct operation and performance boost on arm64,
both network and nvme (this was a previous version which
did not restrict to handle_edge_irq).

Also FWIW there should be nothing architecture-specific in this series.
The only reason I touched arch-specific code was to add initialization
of percpu structs, and that only because I had not found a better way
to run it before interrupts were activated.

Following Thomas' suggestion, this is now being replaced with
a more appropriate, architecture-independent code below

/* Per-CPU state initialization */
static void irq_moderation_percpu_init(void *data)
{
        struct irq_mod_state *ms = this_cpu_ptr(&irq_mod_state);

        hrtimer_setup(&ms->timer, moderation_timer_cb,
CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED_HARD);
        INIT_LIST_HEAD(&ms->descs);
}

static int cpuhp_setup_cb(uint cpu)
{
        irq_moderation_percpu_init(NULL);
        return 0;
}

static int __init init_irq_moderation(void)
{
        on_each_cpu(irq_moderation_percpu_init, NULL, 1);
        irq_mod_info.initialized = 1;
        cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN,
"moderation:online", cpuhp_setup_cb, NULL);
        proc_create_data("irq/soft_moderation", 0644, NULL, &proc_ops,
(void *)0);
        return 0;
}

cheers
luigi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ