2022-04-22 10:31:19

by Heiko Carstens

[permalink] [raw]
Subject: Re: [PATCH 4/9] s390/irq: utilize RCU instead of irq_lock_sparse() in show_msi_interrupt()

On Thu, Apr 21, 2022 at 11:36:17AM +0800, Pingfan Liu wrote:
> Oops. You are right. What about using rcu_read_lock() directly?
>
>
> diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
> index 3033f616e256..45393919fe61 100644
> --- a/arch/s390/kernel/irq.c
> +++ b/arch/s390/kernel/irq.c
> @@ -205,7 +205,7 @@ static void show_msi_interrupt(struct seq_file *p, int irq)
> unsigned long flags;
> int cpu;
>
> - irq_lock_sparse();
> + rcu_read_lock();
> desc = irq_to_desc(irq);
> if (!desc)
> goto out;
> @@ -224,7 +224,7 @@ static void show_msi_interrupt(struct seq_file *p, int irq)
> seq_putc(p, '\n');
> raw_spin_unlock_irqrestore(&desc->lock, flags);
> out:
> - irq_unlock_sparse();
> + rcu_read_unlock();

That looks like it should work. Please resend and also add a reference
to commit 74bdf7815dfb ("genirq: Speedup show_interrupts()") which
explains why this works.


2022-04-22 19:25:18

by Pingfan Liu

[permalink] [raw]
Subject: Re: [PATCH 4/9] s390/irq: utilize RCU instead of irq_lock_sparse() in show_msi_interrupt()

On Thu, Apr 21, 2022 at 01:42:59PM +0200, Heiko Carstens wrote:
> On Thu, Apr 21, 2022 at 11:36:17AM +0800, Pingfan Liu wrote:
> > Oops. You are right. What about using rcu_read_lock() directly?
> >
> >
> > diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
> > index 3033f616e256..45393919fe61 100644
> > --- a/arch/s390/kernel/irq.c
> > +++ b/arch/s390/kernel/irq.c
> > @@ -205,7 +205,7 @@ static void show_msi_interrupt(struct seq_file *p, int irq)
> > unsigned long flags;
> > int cpu;
> >
> > - irq_lock_sparse();
> > + rcu_read_lock();
> > desc = irq_to_desc(irq);
> > if (!desc)
> > goto out;
> > @@ -224,7 +224,7 @@ static void show_msi_interrupt(struct seq_file *p, int irq)
> > seq_putc(p, '\n');
> > raw_spin_unlock_irqrestore(&desc->lock, flags);
> > out:
> > - irq_unlock_sparse();
> > + rcu_read_unlock();
>
> That looks like it should work. Please resend and also add a reference
> to commit 74bdf7815dfb ("genirq: Speedup show_interrupts()") which
> explains why this works.

Thanks for your review. I will follow up with V2.

Regards,

Pingfan