From owner-svn-src-head@freebsd.org Sat Jun 27 19:35:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FE4235AF86; Sat, 27 Jun 2020 19:35:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49vP9R1JLgz4Ms0; Sat, 27 Jun 2020 19:35:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 05RJZF8L085329 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 27 Jun 2020 22:35:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 05RJZF8L085329 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 05RJZFQ2085326; Sat, 27 Jun 2020 22:35:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 27 Jun 2020 22:35:15 +0300 From: Konstantin Belousov To: "Piotr P. Stefaniak" 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> References: <202006271909.05RJ9Xae048991@repo.freebsd.org> <20200627192102.GD32126@kib.kiev.ua> <20200627192932.GA74062@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200627192932.GA74062@freefall.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49vP9R1JLgz4Ms0 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2020 19:35:23 -0000 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.