Re: chainlink.pl /proc/cpuinfo regexp fails on s390x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 22, 2022 at 6:37 PM Andreas Schwab <schwab@xxxxxxxxxxxxxx> wrote:
> On Nov 22 2022, Andreas Hasenack wrote:
> > /^processor[\s\d]*:/
> > or something else.
>
> Something else.
>
> $ getconf _NPROCESSORS_ONLN

Yes, that works too and was (I'm pretty sure) considered during
development. The reason /proc/cpu was chosen over `getconf` was that
opening & reading /proc/cpu should be faster since it doesn't involve
spawning a process. If we did use `getconf`, we'd have to be careful
to degrade gracefully if `getconf` isn't available or if the
configuration parameter (i.e. "_NPROCESSORS_ONLN") isn't known on the
platform.

That said, the submitted patch[1] is probably good enough for now,
especially since there's talk about possibly removing this code
entirely.

[1]: https://lore.kernel.org/git/pull.1385.git.git.1669148861635.gitgitgadget@xxxxxxxxx/



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux