Re: [PATCH] x86/cpu: sort cpuinfo flags

From: Kirill A. Shutemov
Date: Fri Dec 21 2018 - 08:19:35 EST


On Fri, Dec 21, 2018 at 02:04:03PM +0100, Borislav Petkov wrote:
> On Fri, Dec 21, 2018 at 03:40:37PM +0300, Kirill A. Shutemov wrote:
> > But I don't see an improvement in readability of data presented to user as
> > a silly idea.
>
> Improving readability is not a silly idea and I never said that. Rather,
> the cost of what you're trying to accomplish, needs to be weighed.
>
> The final goal of this is, AFAIU, finding whether a feature flag is
> there or not and you can use grep for that now, on *any* kernel.
>
> And if you need the feature flags sorted, you can do that too:
>
> $ grep -m 1 flags /proc/cpuinfo | tr " " "\n" | sort | xargs
>
> and there probably is even a simpler way to do that.
>
> Or add a shell alias for that or a small script or ...

That's very valid point.

Dave's patch made me recall few cases were I wanted to check a presence
of a CPU flag with very limited userspace: shell in initrd with lean
busybox build (no grep around). Eyeballing the flag took frustratingly
long.

Yes, all this can be addressed in userspace one way or another.
But it doesn't take much for kernel to present the data in a more reasonable
way too...

--
Kirill A. Shutemov