svn commit: r362705 - head/bin/ps
Konstantin Belousov
kostikbel at gmail.com
Sat Jun 27 19:35:23 UTC 2020
On Sat, Jun 27, 2020 at 09:29:32PM +0200, Piotr P. Stefaniak wrote:
> On 2020-06-27 22:21:02, Konstantin Belousov wrote:
> > On Sat, Jun 27, 2020 at 07:09:33PM +0000, Piotr Pawel Stefaniak wrote:
> > > Author: pstef
>
> > > @@ -1454,6 +1457,18 @@ pidmax_init(void)
> > > xo_warn("unable to read kern.pid_max");
> > > pid_max = 99999;
> > > }
> > > +}
> > > +
> > > +static void
> > > +smp_init(void)
> > > +{
> > > + size_t size;
> > > +
> > > + size = sizeof(smp);
> > > + if ((sysctlbyname("machdep.smp_active", &smp, &size, NULL, 0) != 0 &&
> > There is no such sysctl machdep.smp_active, and it does not make sense to
> > call it (even if it existed in some ancient FreeBSD version, I am not sure).
>
> top(1) does that.
For top it have some limited value, from what I see, in !smpmode top does
not add the 'C' column in CPU stat mode, which saves space. Still,
machdep.smp_active perhaps should be dropped.
>
> > > + sysctlbyname("kern.smp.active", &smp, &size, NULL, 0) != 0) ||
> > > + size != sizeof(smp))
> > The indent on this and previous lines is wrong.
> >
> > > + smp = 0;
> > > }
> > That said, I do not see why do you need to check this kind of configuration
> > at all, on UP we return CPU 0 for all threads.
>
> I'll remove it.
More information about the svn-src-head
mailing list