From: Thomas Gleixner <tglx@linutronix.de>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Christian Loehle <christian.loehle@arm.com>,
Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [PATCH v1] cpu: Add missing check to cpuhp_smt_enable()
Date: Sun, 07 Sep 2025 15:14:47 +0200 [thread overview]
Message-ID: <87ldmqwgjc.ffs@tglx> (raw)
In-Reply-To: <CAJZ5v0htmEeivbQaumRc7zw_Zx68GpUy98ksA9L42LupjO6tWA@mail.gmail.com>
On Fri, Sep 05 2025 at 22:56, Rafael J. Wysocki wrote:
> On Fri, Sep 5, 2025 at 10:47 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>>
>> On Fri, Sep 05 2025 at 15:27, Rafael J. Wysocki wrote:
>> > On Fri, Sep 5, 2025 at 3:13 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>> >> Well, manual online can be used for onlining the secondary thread of a
>> >> core where the primary thread is offline, so this is technically
>> >> possible already.
>> >>
>> >> > Something like the completely untested below.
>> >>
>> >> So given the above, shouldn't topology_is_core_online() check if any
>> >> thread in the given core is online?
>> >
>> > Besides, this would cause the siblings of offline SMT threads to be
>> > skipped while enabling SMT via sysfs (using
>> > /sys/devices/system/cpu/smt/control), but I'm not sure if this is the
>> > expectation in the field today. The current behavior is to online all
>> > secondary SMT threads (and more, but that part is quite arguably
>> > broken).
>>
>> It is broken, because the initial logic is to bring up primary threads
>> unconditionally and then refuse to bring up sibling threads.
>>
>> With "maxcpus=xxx" this obviously limits the amount of primary threads,
>> so there is arguably no point to online any of the related secondary
>> threads of them.
>>
>> The initial implementation was naively making that assumption, but the
>> core check which was added due to PPC made this actually correct.
>>
>> It just did not snap with me back then, but it's actually the correct
>> thing to do, no?
>
> It would at least be consistent with the existing PPC behavior. :-)
Correct.
next prev parent reply other threads:[~2025-09-07 13:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 20:01 [PATCH v1] cpu: Add missing check to cpuhp_smt_enable() Rafael J. Wysocki
2025-09-02 15:05 ` Rafael J. Wysocki
2025-09-02 16:56 ` Dave Hansen
2025-09-02 17:18 ` Rafael J. Wysocki
2025-09-03 18:00 ` Dave Hansen
2025-09-03 18:35 ` Rafael J. Wysocki
2025-09-05 7:39 ` Thomas Gleixner
2025-09-05 13:13 ` Rafael J. Wysocki
2025-09-05 13:27 ` Rafael J. Wysocki
2025-09-05 20:47 ` Thomas Gleixner
2025-09-05 20:56 ` Rafael J. Wysocki
2025-09-07 13:14 ` Thomas Gleixner [this message]
2025-09-11 10:31 ` Rafael J. Wysocki
2025-09-21 8:56 ` [PATCH] x86/topology: Implement topology_is_core_online() to address SMT regression Thomas Gleixner
2025-09-21 11:00 ` Christian Loehle
2025-09-22 15:42 ` Rafael J. Wysocki
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=87ldmqwgjc.ffs@tglx \
--to=tglx@linutronix.de \
--cc=christian.loehle@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox