From: Thomas Gleixner <tglx@linutronix.de>
To: Bitao Hu <yaoma@linux.alibaba.com>,
dianders@chromium.org, akpm@linux-foundation.org,
liusong@linux.alibaba.com, pmladek@suse.com,
kernelfans@gmail.com, deller@gmx.de, npiggin@gmail.com,
tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com,
jan.kiszka@siemens.com
Cc: linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
yaoma@linux.alibaba.com
Subject: Re: [PATCHv9 2/3] irq: use a struct for the kstat_irqs in the interrupt descriptor
Date: Fri, 23 Feb 2024 08:29:36 +0100 [thread overview]
Message-ID: <87frxjeizj.ffs@tglx> (raw)
In-Reply-To: <3f4b7dbe-93c1-4cb0-8233-18e8432409f8@linux.alibaba.com>
On Fri, Feb 23 2024 at 15:18, Bitao Hu wrote:
> On 2024/2/22 21:22, Thomas Gleixner wrote:
>>> - if (desc->kstat_irqs) {
>>> - for_each_online_cpu(j)
>>> - any_count |= data_race(*per_cpu_ptr(desc->kstat_irqs, j));
>>> - }
>>> + if (desc->kstat_irqs)
>>> + any_count = data_race(desc->tot_count);
>>
>> This is an unrelated change and needs to be split out into a separate
>> patch with a proper changelog which explains why this is equivalent.
>>
>
> Alright, I will remove this change witch is not related to the purpose
> of this patch.
>
> I guess that the purpose of suggesting this change in your V1 response
> was to speedup the 'show_interrupts'. However, after reviewing the
> usage of 'desc->tot_count' in 'unsigned int kstat_irqs(unsigned int
> irq)', I think the change might be as follows:
>
> diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
> index 623b8136e9af..53b8d6edd7ac 100644
> --- a/kernel/irq/proc.c
> +++ b/kernel/irq/proc.c
> @@ -489,8 +489,13 @@ int show_interrupts(struct seq_file *p, void *v)
> goto outsparse;
>
> if (desc->kstat_irqs) {
> - for_each_online_cpu(j)
> - any_count |=
> data_race(per_cpu(desc->kstat_irqs->cnt, j));
> + if (!irq_settings_is_per_cpu_devid(desc) &&
> + !irq_settings_is_per_cpu(desc) &&
> + !irq_is_nmi(desc))
> + any_count = data_race(desc->tot_count);
> + else
> + for_each_online_cpu(j)
> + any_count |=
> data_race(per_cpu(desc->kstat_irqs->cnt, j));
> }
>
> if ((!desc->action || irq_desc_is_chained(desc)) && !any_count)
>
> Is my idea correct?
Yes.
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Gleixner <tglx@linutronix.de>
To: Bitao Hu <yaoma@linux.alibaba.com>,
dianders@chromium.org, akpm@linux-foundation.org,
liusong@linux.alibaba.com, pmladek@suse.com,
kernelfans@gmail.com, deller@gmx.de, npiggin@gmail.com,
tsbogend@alpha.franken.de, James.Bottomley@HansenPartnership.com,
jan.kiszka@siemens.com
Cc: yaoma@linux.alibaba.com, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org,
linux-mips@vger.kernel.org
Subject: Re: [PATCHv9 2/3] irq: use a struct for the kstat_irqs in the interrupt descriptor
Date: Fri, 23 Feb 2024 08:29:36 +0100 [thread overview]
Message-ID: <87frxjeizj.ffs@tglx> (raw)
In-Reply-To: <3f4b7dbe-93c1-4cb0-8233-18e8432409f8@linux.alibaba.com>
On Fri, Feb 23 2024 at 15:18, Bitao Hu wrote:
> On 2024/2/22 21:22, Thomas Gleixner wrote:
>>> - if (desc->kstat_irqs) {
>>> - for_each_online_cpu(j)
>>> - any_count |= data_race(*per_cpu_ptr(desc->kstat_irqs, j));
>>> - }
>>> + if (desc->kstat_irqs)
>>> + any_count = data_race(desc->tot_count);
>>
>> This is an unrelated change and needs to be split out into a separate
>> patch with a proper changelog which explains why this is equivalent.
>>
>
> Alright, I will remove this change witch is not related to the purpose
> of this patch.
>
> I guess that the purpose of suggesting this change in your V1 response
> was to speedup the 'show_interrupts'. However, after reviewing the
> usage of 'desc->tot_count' in 'unsigned int kstat_irqs(unsigned int
> irq)', I think the change might be as follows:
>
> diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
> index 623b8136e9af..53b8d6edd7ac 100644
> --- a/kernel/irq/proc.c
> +++ b/kernel/irq/proc.c
> @@ -489,8 +489,13 @@ int show_interrupts(struct seq_file *p, void *v)
> goto outsparse;
>
> if (desc->kstat_irqs) {
> - for_each_online_cpu(j)
> - any_count |=
> data_race(per_cpu(desc->kstat_irqs->cnt, j));
> + if (!irq_settings_is_per_cpu_devid(desc) &&
> + !irq_settings_is_per_cpu(desc) &&
> + !irq_is_nmi(desc))
> + any_count = data_race(desc->tot_count);
> + else
> + for_each_online_cpu(j)
> + any_count |=
> data_race(per_cpu(desc->kstat_irqs->cnt, j));
> }
>
> if ((!desc->action || irq_desc_is_chained(desc)) && !any_count)
>
> Is my idea correct?
Yes.
next prev parent reply other threads:[~2024-02-23 7:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 9:34 [PATCHv9 0/3] *** Detect interrupt storm in softlockup *** Bitao Hu
2024-02-22 9:34 ` Bitao Hu
2024-02-22 9:34 ` [PATCHv9 1/3] watchdog/softlockup: low-overhead detection of interrupt storm Bitao Hu
2024-02-22 9:34 ` Bitao Hu
2024-02-22 9:34 ` [PATCHv9 2/3] irq: use a struct for the kstat_irqs in the interrupt descriptor Bitao Hu
2024-02-22 9:34 ` Bitao Hu
2024-02-22 13:22 ` Thomas Gleixner
2024-02-22 13:22 ` Thomas Gleixner
2024-02-23 7:18 ` Bitao Hu
2024-02-23 7:18 ` Bitao Hu
2024-02-23 7:29 ` Thomas Gleixner [this message]
2024-02-23 7:29 ` Thomas Gleixner
2024-02-22 9:34 ` [PATCHv9 3/3] watchdog/softlockup: report the most frequent interrupts Bitao Hu
2024-02-22 9:34 ` Bitao Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87frxjeizj.ffs@tglx \
--to=tglx@linutronix.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=deller@gmx.de \
--cc=dianders@chromium.org \
--cc=jan.kiszka@siemens.com \
--cc=kernelfans@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=liusong@linux.alibaba.com \
--cc=npiggin@gmail.com \
--cc=pmladek@suse.com \
--cc=tsbogend@alpha.franken.de \
--cc=yaoma@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.