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] [day] [month] [year] [list]
Date: Fri, 23 Feb 2024 08:29:36 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Bitao Hu <yaoma@...ux.alibaba.com>, dianders@...omium.org,
 akpm@...ux-foundation.org, liusong@...ux.alibaba.com, pmladek@...e.com,
 kernelfans@...il.com, deller@....de, npiggin@...il.com,
 tsbogend@...ha.franken.de, James.Bottomley@...senPartnership.com,
 jan.kiszka@...mens.com
Cc: linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
 linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
 yaoma@...ux.alibaba.com
Subject: Re: [PATCHv9 2/3] irq: use a struct for the kstat_irqs in the
 interrupt descriptor

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ