[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87sfajofrz.fsf@mail.lhotse>
Date: Thu, 22 Jun 2023 22:14:24 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Thomas Gleixner <tglx@...utronix.de>,
Laurent Dufour <ldufour@...ux.ibm.com>,
linux-kernel@...r.kernel.org
Cc: linux-arch@...r.kernel.org, x86@...nel.org,
linuxppc-dev@...ts.ozlabs.org, npiggin@...il.com,
christophe.leroy@...roup.eu, dave.hansen@...ux.intel.com,
mingo@...hat.com, bp@...en8.de
Subject: Re: [PATCH 07/10] cpu/SMT: Allow enabling partial SMT states via sysfs
Thomas Gleixner <tglx@...utronix.de> writes:
> On Thu, Jun 15 2023 at 17:46, Laurent Dufour wrote:
>>
>> - if (ctrlval != cpu_smt_control) {
>> + orig_threads = cpu_smt_num_threads;
>> + cpu_smt_num_threads = num_threads;
>> +
>> + if (num_threads > orig_threads) {
>> + ret = cpuhp_smt_enable();
>> + } else if (num_threads < orig_threads) {
>> + ret = cpuhp_smt_disable(ctrlval);
>> + } else if (ctrlval != cpu_smt_control) {
>> switch (ctrlval) {
>> case CPU_SMT_ENABLED:
>> ret = cpuhp_smt_enable();
>
> This switch() is still as pointless as in the previous version.
>
> OFF -> ON, ON -> OFF, ON -> FORCE_OFF are covered by the num_threads
> comparisons.
>
> So the only case where (ctrlval != cpu_smt_control) is relevant is the
> OFF -> FORCE_OFF transition because in that case the number of threads
> is not changing.
>
> force_off = ctrlval != cpu_smt_control && ctrval == CPU_SMT_FORCE_DISABLED;
>
> if (num_threads > orig_threads)
> ret = cpuhp_smt_enable();
> else if (num_threads < orig_threads || force_off)
> ret = cpuhp_smt_disable(ctrlval);
>
> Should just work, no?
Yes, I think so.
I'll fold that in and do a respin of this series for 6.6 in the next
week or two.
cheers
Powered by blists - more mailing lists