Re: [patch V2 06/45] genirq/proc: Switch to lock guards
From: Zenghui Yu
Date: Sun Jun 08 2025 - 08:46:02 EST
Hi Thomas,
On 2025/4/29 14:54, Thomas Gleixner wrote:
> Convert all lock/unlock pairs to guards and tidy up the code.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>
> ---
> kernel/irq/proc.c | 65 +++++++++++++++++++-----------------------------------
> 1 file changed, 24 insertions(+), 41 deletions(-)
>
> --- a/kernel/irq/proc.c
> +++ b/kernel/irq/proc.c
> @@ -81,20 +81,18 @@ static int show_irq_affinity(int type, s
> static int irq_affinity_hint_proc_show(struct seq_file *m, void *v)
> {
> struct irq_desc *desc = irq_to_desc((long)m->private);
> - unsigned long flags;
> cpumask_var_t mask;
>
> if (!zalloc_cpumask_var(&mask, GFP_KERNEL))
> return -ENOMEM;
>
> - raw_spin_lock_irqsave(&desc->lock, flags);
> - if (desc->affinity_hint)
> - cpumask_copy(mask, desc->affinity_hint);
> - raw_spin_unlock_irqrestore(&desc->lock, flags);
> + scoped_guard(raw_spinlock_irq, &desc->lock) {
Any reason it has been switched to a raw_spinlock_irq?
I've hit some random Oops with the backtrace looks like:
Call trace:
string+0x110/0x3b8 (P)
vsnprintf+0x2f0/0xac8
seq_printf+0x180/0x220
show_interrupts+0x4e0/0x7e0
seq_read_iter+0x350/0xd80
proc_reg_read_iter+0x194/0x248
vfs_read+0x5b0/0x940
ksys_read+0xf0/0x1e8
__arm64_sys_read+0x74/0xb0
invoke_syscall+0x74/0x270
el0_svc_common.constprop.0+0xb4/0x240
do_el0_svc+0x48/0x68
el0_svc+0x4c/0xe8
el0t_64_sync_handler+0xc8/0xd0
el0t_64_sync+0x1ac/0x1b0
I haven't dig further. But it looks to me that this patch had introduced
functional change and I'm planning to give the following diff a go on
the same box.
Thanks,
Zenghui