[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45b7034e-67f4-4f8b-bef3-5350f6419e79@samsung.com>
Date: Thu, 8 May 2025 16:56:30 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: Thomas Gleixner <tglx@...utronix.de>, LKML
<linux-kernel@...r.kernel.org>
Cc: Jiri Slaby <jirislaby@...nel.org>, Peter Zijlstra <peterz@...radead.org>
Subject: Re: [patch V2 09/45] genirq/cpuhotplug: Convert to lock guards
Hi Thomas,
On 29.04.2025 08:55, Thomas Gleixner wrote:
> Convert all lock/unlock pairs to guards and tidy up the code.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
>
> ---
> kernel/irq/cpuhotplug.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> --- a/kernel/irq/cpuhotplug.c
> +++ b/kernel/irq/cpuhotplug.c
> @@ -177,9 +177,8 @@ void irq_migrate_all_off_this_cpu(void)
> bool affinity_broken;
>
> desc = irq_to_desc(irq);
> - raw_spin_lock(&desc->lock);
> - affinity_broken = migrate_one_irq(desc);
> - raw_spin_unlock(&desc->lock);
> + scoped_guard(raw_spinlock, &desc->lock)
> + affinity_broken = migrate_one_irq(desc);
>
> if (affinity_broken) {
> pr_debug_ratelimited("IRQ %u: no longer affine to CPU%u\n",
> @@ -244,9 +243,8 @@ int irq_affinity_online_cpu(unsigned int
> irq_lock_sparse();
> for_each_active_irq(irq) {
> desc = irq_to_desc(irq);
> - raw_spin_lock_irq(&desc->lock);
> - irq_restore_affinity_of_irq(desc, cpu);
> - raw_spin_unlock_irq(&desc->lock);
> + scoped_guard(raw_spinlock, &desc->lock)
The above should be "scoped_guard(raw_spinlock_irq, &desc->lock)", otherwise the cpu hotplug is broken as in today's linux-next.
> + irq_restore_affinity_of_irq(desc, cpu);
> }
> irq_unlock_sparse();
>
>
>
>
>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Powered by blists - more mailing lists