linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Dufour <ldufour@linux.ibm.com>
To: "Zhang, Rui" <rui.zhang@intel.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	lkp <lkp@intel.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"npiggin@gmail.com" <npiggin@gmail.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [PATCH v3 6/9] cpu/SMT: Allow enabling partial SMT states via sysfs
Date: Wed, 5 Jul 2023 13:57:05 +0200	[thread overview]
Message-ID: <a7b7df27-d49c-a6a7-46a0-47cc1098e644@linux.ibm.com> (raw)
In-Reply-To: <5801fb9a94c2ce00ca44220be0b1a5bd7f8ff44f.camel@intel.com>



Le 05/07/2023 à 05:14, Zhang, Rui a écrit :
> On Thu, 2023-06-29 at 16:31 +0200, Laurent Dufour wrote:
>> @@ -2580,6 +2597,17 @@ static ssize_t control_show(struct device
>> *dev,
>>   {
>>          const char *state = smt_states[cpu_smt_control];
>>   
>> +#ifdef CONFIG_HOTPLUG_SMT
>> +       /*
>> +        * If SMT is enabled but not all threads are enabled then
>> show the
>> +        * number of threads. If all threads are enabled show "on".
>> Otherwise
>> +        * show the state name.
>> +        */
>> +       if (cpu_smt_control == CPU_SMT_ENABLED &&
>> +           cpu_smt_num_threads != cpu_smt_max_threads)
>> +               return sysfs_emit(buf, "%d\n", cpu_smt_num_threads);
>> +#endif
>> +
> 
> My understanding is that cpu_smt_control is always set to
> CPU_SMT_NOT_IMPLEMENTED when CONFIG_HOTPLUG_SMT is not set, so this
> ifdef is not necessary, right?

Hi Rui,

Indeed, cpu_smt_control, cpu_smt_num_threads and cpu_smt_max_threads are 
only defined when CONFIG_HOTPLUG_SMT is set. This is the reason for this 
#ifdef block.

This has been reported by the kernel test robot testing v2:
https://lore.kernel.org/oe-kbuild-all/202306282340.Ihqm0fLA-lkp@intel.com

Cheers,
Laurent.

  reply	other threads:[~2023-07-05 11:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 14:31 [PATCH v3 0/9] Introduce SMT level and add PowerPC support Laurent Dufour
2023-06-29 14:31 ` [PATCH v3 1/9] cpu/SMT: Move SMT prototypes into cpu_smt.h Laurent Dufour
2023-06-29 14:31 ` [PATCH v3 2/9] cpu/SMT: Move smt/control simple exit cases earlier Laurent Dufour
2023-06-29 14:31 ` [PATCH v3 3/9] cpu/SMT: Store the current/max number of threads Laurent Dufour
2023-07-05  3:05   ` Zhang, Rui
2023-07-05 11:58     ` Laurent Dufour
2023-06-29 14:31 ` [PATCH v3 4/9] cpu/SMT: Remove topology_smt_supported() Laurent Dufour
2023-06-29 14:31 ` [PATCH v3 5/9] cpu/SMT: Create topology_smt_thread_allowed() Laurent Dufour
2023-06-29 14:31 ` [PATCH v3 6/9] cpu/SMT: Allow enabling partial SMT states via sysfs Laurent Dufour
2023-07-05  3:14   ` Zhang, Rui
2023-07-05 11:57     ` Laurent Dufour [this message]
2023-06-29 14:31 ` [PATCH v3 7/9] powerpc/pseries: Initialise CPU hotplug callbacks earlier Laurent Dufour
2023-06-29 14:31 ` [PATCH v3 8/9] powerpc: Add HOTPLUG_SMT support Laurent Dufour
2023-06-30 15:19   ` Laurent Dufour
2023-06-29 14:31 ` [PATCH v3 9/9] powerpc/pseries: Honour current SMT state when DLPAR onlining CPUs Laurent Dufour
2023-06-30 13:32 ` [PATCH v3 0/9] Introduce SMT level and add PowerPC support Sachin Sant
2023-06-30 13:41   ` Laurent Dufour
2023-07-05  3:04 ` Zhang, Rui
2023-07-05 11:53   ` Laurent Dufour

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=a7b7df27-d49c-a6a7-46a0-47cc1098e644@linux.ibm.com \
    --to=ldufour@linux.ibm.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkp@intel.com \
    --cc=mingo@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=rui.zhang@intel.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).