linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
	Andrea Arcangeli <aarcange@redhat.com>,
	Waiman Long <longman@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Jiri Kosina <jikos@kernel.org>
Subject: Re: [PATCH] cpu/hotplug: Create SMT sysfs interface for all arches
Date: Tue, 26 Mar 2019 08:32:36 -0500	[thread overview]
Message-ID: <20190326133236.lylrrbacznezybjm@treble> (raw)
In-Reply-To: <alpine.DEB.2.21.1903242104280.1798@nanos.tec.linutronix.de>

On Sun, Mar 24, 2019 at 09:13:18PM +0100, Thomas Gleixner wrote:
> On Fri, 1 Mar 2019, Josh Poimboeuf wrote:
> > Make the /sys/devices/system/cpu/smt/* files available on all arches, so
> > user space has a consistent way to detect whether SMT is enabled.
> > 
> > The 'control' file now shows 'notsupported' for architectures which
> > don't yet have CONFIG_HOTPLUG_SMT.
> 
> I'm slowly crawling through my backlog ...
> 
> > --- a/Documentation/ABI/testing/sysfs-devices-system-cpu
> > +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
> > @@ -514,7 +514,8 @@ Description:	Control Symetric Multi Threading (SMT)
> >  			 "on"		SMT is enabled
> >  			 "off"		SMT is disabled
> >  			 "forceoff"	SMT is force disabled. Cannot be changed.
> > -			 "notsupported" SMT is not supported by the CPU
> > +			 "notsupported" Runtime SMT toggling is not currently
> > +					supported for the architecture
> 
> Second thoughts. I'm not really convinced that changing the meaning of
> notsupported and in fact overloading it, is the right thing to do.
> notsupported means now:
> 
>   CPU does not support it - OR - architecture does not support it
> 
> That's not pretty and we are surely not short of state space. There are
> several options for handling this:
> 
>  1) Do not expose the state file, just expose the active file
> 
>  2) Expose the state file, but return -ENOTSUPP or some other sensible error
>     code
> 
>  3) Expose the state file and let show return 'notimplemented' which is
>     more accurate. That wouldn't even require to expand the state space
>     enum. It just can be returned unconditionally.

Makes sense.  I like #3.  I can post another version.

-- 
Josh

  reply	other threads:[~2019-03-26 13:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01 17:42 [PATCH] cpu/hotplug: Create SMT sysfs interface for all arches Josh Poimboeuf
2019-03-06 15:44 ` Thomas Gleixner
2019-03-24 20:13 ` Thomas Gleixner
2019-03-26 13:32   ` Josh Poimboeuf [this message]
2019-03-26 13:53     ` Thomas Gleixner
2019-03-26 18:03       ` Josh Poimboeuf
2019-03-26 18:34         ` Thomas Gleixner

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=20190326133236.lylrrbacznezybjm@treble \
    --to=jpoimboe@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).