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]
Message-ID: <SL2PR06MB308257AED496B4E8D10DB6A5BDCB9@SL2PR06MB3082.apcprd06.prod.outlook.com>
Date:   Thu, 12 May 2022 12:52:24 +0000
From:   王擎 <wangqing@...o.com>
To:     Dietmar Eggemann <dietmar.eggemann@....com>,
        Sudeep Holla <sudeep.holla@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] arch_topology: support parsing cluster_id from DT


>> 
>>>> From: Wang Qing <wangqing@...o.com>
>
>[...]
>
>>> Would have to be cluster_id = -1. 0 is a valid 2. level cluster.
>>> Otherwise you're not removing the CLS data from CPU4 to CPU7 in the
>>> `Armv9 with L2 complexes` cpu-map example I used for testing:
>>>
>>>                 cpu-map {
>>>                         cluster0 {
>>>                                 cluster0 {
>>>                                         core0 {
>>>                                                 cpu = <&cpu0>;
>>>                                         };
>>>                                         core1 {
>>>                                                 cpu = <&cpu1>;
>>>                                         };
>>>                                 };
>>>                                 cluster1 {
>>>                                         core0 {
>>>                                                 cpu = <&cpu2>;
>>>                                         };
>>>                                         core1 {
>>>                                                 cpu = <&cpu3>;
>>>                                         };
>>>                                 };
>>>                         };
>>>                         cluster1 {
>>>                                 core0 {
>>>                                         cpu = <&cpu4>;
>>>                                 };
>>>                                 core1 {
>>>                                         cpu = <&cpu5>;
>>>                                 };
>>>                                 core2 {
>>>                                         cpu = <&cpu6>;
>>>                                 };
>>>                         };
>>>                         cluster2 {
>>>                                 core0 {
>>>                                         cpu = <&cpu7>;
>>>                                 };
>>>                         };
>>>                 };
>
>[...]
>
>>> Looks like you also need to adapt update_siblings_masks() to only set
>>> cpu in &cpu_topo->thread_sibling and &cpuid_topo->thread_sibling when
>>> `cpu_topo->thread_id != -1`.
>>>
>>> @@ -723,11 +723,11 @@ void update_siblings_masks(unsigned int cpuid)
>>>                 cpumask_set_cpu(cpuid, &cpu_topo->core_sibling);
>>>                 cpumask_set_cpu(cpu, &cpuid_topo->core_sibling);
>>>
>>> -               if (cpuid_topo->core_id != cpu_topo->core_id)
>>> -                       continue;
>>> -
>>> -               cpumask_set_cpu(cpuid, &cpu_topo->thread_sibling);
>>> -               cpumask_set_cpu(cpu, &cpuid_topo->thread_sibling);
>>> +               if (cpu_topo->thread_id != -1 &&
>>> +                   cpuid_topo->core_id == cpu_topo->core_id) {
>>> +                       cpumask_set_cpu(cpuid, &cpu_topo->thread_sibling);
>>> +                       cpumask_set_cpu(cpu, &cpuid_topo->thread_sibling);
>>> +
>> 
>> This seems like another problem?
>
>I don't think so. If you run a system with the cpu-map mentioned above

Here is not enough, cpu0,1,4,5 will make up SMT below:
cluster0 {
        cluster0 {
                core0 {
                        thread0 {
                                 cpu = <&CPU0>;
                                };
                        thread1 {
                                 cpu = <&CPU1>;
                                };
                      };
                };
                core1 {
                        thread0 {
                                 cpu = <&CPU2>;
                                };
                        thread1 {
                                 cpu = <&CPU3>;
                                };
                      };
                };
        cluster1 {
                core0 {
                        thread0 {
                                 cpu = <&CPU4>;
                                };
                        thread1 {
                                 cpu = <&CPU5>;
                                };
                      };
                };
                core1 {
                        thread0 {
                                 cpu = <&CPU6>;
                                };
                        thread1 {
                                 cpu = <&CPU7>;
                                };
                      };
                };
...
I will handle this.

Thanks,
Qing

>you get:
>
># cat /sys/kernel/debug/sched/domains/cpu0/domain*/name
>SMT        <-- !!!
>CLS
>MC
>
>root@...5579:~# cat /proc/schedstat | awk '{print $1 " " $2 }' | grep
>^[cd] | head -5
>cpu0 0
>domain0 05 <-- !!!
>domain1 07 <-- !!!
>domain2 0f
>domain3 ff
>
>So you get an unwanted SMT level for CPU0-3 and messed-up cpumasks
>without this change.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ