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: <Y8fBL+h2l5Wsiq2Z@hovoldconsulting.com>
Date:   Wed, 18 Jan 2023 10:51:43 +0100
From:   Johan Hovold <johan@...nel.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Johan Hovold <johan+linaro@...nel.org>,
        Marc Zyngier <maz@...nel.org>, x86@...nel.org,
        platform-driver-x86@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-mips@...r.kernel.org,
        linux-kernel@...r.kernel.org, Hsin-Yi Wang <hsinyi@...omium.org>,
        Mark-PK Tsai <mark-pk.tsai@...iatek.com>
Subject: Re: [PATCH v4 19/19] irqdomain: Switch to per-domain locking

On Tue, Jan 17, 2023 at 10:50:39PM +0100, Thomas Gleixner wrote:
> On Mon, Jan 16 2023 at 14:50, Johan Hovold wrote:
> > The IRQ domain structures are currently protected by the global
> > irq_domain_mutex. Switch to using more fine-grained per-domain locking,
> > which may potentially speed up parallel probing somewhat.
> 
> Does it or not?
> 
> If not then why adding all this churn for no real value?

It probably doesn't make much difference, but Marc wanted per-domain
locking:

    > I'd really like to avoid a global mutex. At the very least this should
    > be a per-domain mutex, otherwise this will serialise a lot more than
    > what is needed.
    
    Yeah, I considered that too, but wanted to get your comments on this
    first.
    
    Also note that the likewise global irq_domain_mutex (and
    sparse_irq_lock) are taken in some of these paths so perhaps using finer
    locking won't actually matter that much as this is mostly for parallel
    probing.

    https://lore.kernel.org/lkml/YuKHiZuNvN+K9NCc@hovoldconsulting.com/

As part of fixing the races, this series has now replaced the per-domain
revmap mutexes with the global irq_domain_mutex, which could possibly be
perceived as a step in the wrong direction in this respect.

This patch restores per-domain locking for non-hierarchical domains and
extends it to hierarchical domains. This leaves the irq_domain_mutex to
only be used for things that actually need a global lock such as the
domain list.

I consider this mostly a clean up, and I did intentionally place it last
in order to not have the fixes depend on it.

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ