Re: git: d9d5f2c042a5 - main - cpuset: add --count

From: Alexey Dokuchaev <danfe_at_freebsd.org>
Date: Sun, 05 Feb 2023 17:28:50 UTC
On Sun, Feb 05, 2023 at 04:42:16PM +0100, Mateusz Guzik wrote:
> On 2/5/23, Alexey Dokuchaev <danfe@freebsd.org> wrote:
> > On Sat, Feb 04, 2023 at 05:51:27PM +0000, Mateusz Guzik wrote:
> >> commit d9d5f2c042a51a9f0dd69eb1fc349efd81ffa483
> >>
> >>   cpuset: add --count
> >>
> >>   Can be used to count the number of hardware threads in the cpu set.
> >>
> >>   For example: [...]
> >>
> >>   The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus
> >
> > Speaking of these two, do we really need both, unless they are not
> > exactly the same?  (They do seem so, though.)
> 
> They are not, cpuset grabs a pid argument, while nproc only works on itself.

cpuset? pid argument?  But I was not asking about cpuset, I was wondering
whether we need both of these sysctls:

$ sysctl hw.ncpu
hw.ncpu: 2
$ sysctl kern.smp.cpus
kern.smp.cpus: 2

./danfe