linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: Thomas Gleixner <tglx@linutronix.de>,
	Felix Schnizlein <fschnizlein@suse.com>
Cc: linux-arch@vger.kernel.org,
	Felix Schnizlein <fschnizlein@suse.de>,
	Greg KH <gregkh@linuxfoundation.org>,
	x86@kernel.org, will.deacon@arm.com, linux@armlinux.org.uk,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] x86 cpuinfo: implement sysfs nodes for x86
Date: Wed, 11 Dec 2019 11:42:35 +0100	[thread overview]
Message-ID: <4737004.4U1sY2OxSp@skinner.arch.suse.de> (raw)
In-Reply-To: <87sglroqix.fsf@nanos.tec.linutronix.de>

On Tuesday, December 10, 2019 9:48:54 PM CET Thomas Gleixner wrote:
> Greg KH <gregkh@linuxfoundation.org> writes:
> > On Fri, Dec 06, 2019 at 05:24:20PM +0100, Thomas Renninger wrote:
> >> From: Felix Schnizlein <fschnizlein@suse.de>
> >> ==> flags <==
> >> fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36
> >> clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc
> >> rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq ssse3 fma
> >> cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave
> >> avx f16c rdrand hypervisor lahf_lm abm cpuid_fault invpcid_single pti
> >> ssbd ibrs ibpb fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
> >> xsaveopt arat umip> 
> > One file with all of that?  We are going to run into problems
> > eventually, that should be split up.
> > 
> > Just like bugs, that's going to just grow over time and eventually
> > overflow PAGE_SIZE :(
> > 
> > Make this:
> >   ├── flags
> >   │   ├── fpu
> >   │   ├── vme
> > 
> > ...
> > 
> > Much simpler to parse, right?
> 
> Well, I'm not really sure whether 100+ files are simpler to parse.
> 
> Aside of that I really don't see the value for 100+ files per CPU which
> are just returning 1 or True or whatever as long as you are not
> suggesting to provide real feature files which have 0/1 or True/False
> content.

I also do not like the one file per cpu flag approach.
This still is one "data"/"info" per sysfs file.
Similar to:
cpu/cpufreq/policy1/scaling_available_governors
and probably a lot others. If PAGE_SIZE overflow has to be cared for, then be 
it.
 
> But I still don't get the whole thing. The only "argument" I've seen so
> far is the 'proc moves to sys' mantra, but that does not make it any
> better.
> 
> We won't get rid of /proc/cpuinfo for a very long time simply because
> too much userspace uses it.

The reason we will never get rid of it is:
Newly written userspace tools still (have to) make use it.
This is because of a small set of remaining info which is convenient
to have in userspace but which is not avail in sysfs yet.

Therefore only x of the 26 /proc/cpuinfo data has been picked up.

For decades unused info like:
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
power management:

shall die at (long but) some point of time.

It's quite some years ago when acpi and cpufreq proc info first got
deprecated and duplicated in sys.
It has been said that it needs years of deprecation that the event file
on which damons were listening for acpi events can ever be removed...
It has been 2013 when the removal has been done, more than 5 years ago:
1696d9dc57e062ce5200f6a42a6aaada15b434bb
ACPI: Remove the old /proc/acpi/event interface

/proc/cpuinfo may need some years more, but there should be no
reason it is still getting used.

> Introducing a mess in /sys/ in parallel just
> for following the mantra does not help much.
 
> Also IF we ever expose feature flags in sys then this needs to be a
> split ino
> 
>   cpu/common_features
> 
> and
> 
>   cpu/CPU$N/unique_features

Makes sense.
feature (without common/unique) is also a better naming than flags.

If Greg (and others) are ok, I would add "page size exceeding" handling.
Hm, quick searching for an example I realize that debugfs can exceed page 
size. Is it that hard to expose a sysfs file larger than page size?

> On most systems unique_features wont exist, but there is such stuff on
> the horizon.

I still wait a bit before doing work for nothing.
I hope everybody agrees, that remaining useful info in /proc/cpuinfo should
show up in /sys if that did not happen yet. And that userspace tools should
not (need to) make use of /proc/cpuinfo anymore.

    Thomas



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-12-11 10:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 16:24 [PATCH v5 0/3] sysfs: add sysfs based cpuinfo Thomas Renninger
2019-12-06 16:24 ` [PATCH 1/3] cpuinfo: add sysfs based arch independent cpuinfo framework Thomas Renninger
2019-12-06 16:33   ` Greg KH
2019-12-06 16:56   ` Randy Dunlap
2019-12-06 16:24 ` [PATCH 2/3] x86 cpuinfo: implement sysfs nodes for x86 Thomas Renninger
2019-12-06 16:36   ` Greg KH
2019-12-10 20:48     ` Thomas Gleixner
2019-12-10 20:53       ` Greg KH
2019-12-11 10:42       ` Thomas Renninger [this message]
2019-12-11 13:56         ` Greg KH
2019-12-11 14:12           ` Thomas Renninger
2019-12-11 14:26             ` Greg KH
2019-12-11 14:52               ` Thomas Renninger
2019-12-11 14:57                 ` Greg KH
2019-12-06 16:24 ` [PATCH 3/3] arm64 cpuinfo: implement sysfs nodes for arm64 Thomas Renninger
2019-12-06 16:37   ` Greg KH
2019-12-09 10:31   ` Will Deacon
2019-12-09 11:28     ` Thomas Renninger
2019-12-09 17:38       ` Will Deacon
2019-12-10 13:33         ` Thomas Renninger
2019-12-10 14:47           ` Greg KH
2019-12-10 16:24             ` Thomas Renninger
2019-12-06 16:58 ` [PATCH v5 0/3] sysfs: add sysfs based cpuinfo Mark Rutland
2019-12-06 17:29   ` Thomas Renninger
2019-12-06 18:16     ` Mark Rutland

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=4737004.4U1sY2OxSp@skinner.arch.suse.de \
    --to=trenn@suse.de \
    --cc=fschnizlein@suse.com \
    --cc=fschnizlein@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    --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).