Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jun 2020 22:35:15 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        "Piotr P. Stefaniak" <pstef@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r362705 - head/bin/ps
Message-ID:  <20200627193515.GE32126@kib.kiev.ua>
In-Reply-To: <20200627192932.GA74062@freefall.freebsd.org>
References:  <202006271909.05RJ9Xae048991@repo.freebsd.org> <20200627192102.GD32126@kib.kiev.ua> <20200627192932.GA74062@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200627193515.GE32126>