From owner-freebsd-current@freebsd.org Mon Dec 24 23:38:42 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D02511352C38 for ; Mon, 24 Dec 2018 23:38:41 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-21.consmr.mail.ne1.yahoo.com (sonic316-21.consmr.mail.ne1.yahoo.com [66.163.187.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0F7A716BB for ; Mon, 24 Dec 2018 23:38:40 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: o64K0YYVM1kEmRO4hBAMSRDl7ecWgOn6WjgidNa8XnPB8GPErgfkWeOmX3EPR1e GS5yu1F_E2Aj9aRrvcUcdt0UBSmFNpGPv_p88eekDdOMYfw5SPH9xPYze_RpByVCH_jPzR6PslNN QpSj0THlF1lfXWVNinFci.fqgCZZF4oBAPfwrP9b3RINv1GutjA.C4iCYKA.BgOYAjS4thEzfeo5 tc2uiwi9CedJ6Eb0UkGnmOEc8kaMRJQk2DH8YTVgKOVMyvmD.jb1uNS0sYqsJavAIw0djQRFMQbS pj6d35NaKoddXEmXEWAseXFebUoF8llLEYKFh9EUWAExPpkOb2BwgwrkIZ6p_wyHn6v2Sw21mwh8 hUJKqEaCdTPxWnOaIIjFRb3NBMHxrP63oDhATrFdGVt5dMswx7r4bfCGNjU0k7c55OfhHWZwB_w. Xe5347SZa1n3ZSGyLVccSS89.I9JXOLrx_zk62r8SuAA9BEJKzXyqYLMroML1g_7xYvFWg.h4FW8 1C_xlWubpjorkzrMX_T0C2GKBevKeSEPnAxkJRhlO2eAyBDN0OO2S8AzYI783p9mxsarMgFJU_by E_Eg5YdCghYHFEFZzwQlvwHdvTa2ZB236OQvJ6dbBeXW9j1orfBHhVyt6ajsuUWxL2r2urMfZAm0 VJEpr.uFCn2i3nB1WjxWhDh_c5b.rsI.CPuAdkeWLtKkZCGR9j2.ilPzuyoPLSUIBiUImAngOxHj 9mBYzsm8XLTrHSBVICgYPo.TqyCsdGFG4Ol3QxewGzx1gmT8y9TlX2Tq4r8o24vRt7gINvVmzADv DeUKX0xD3o_bOJYyyQyZ2sKbKKVe0AwPV_TPwoVwfE3edClbrefkWWtIh3GzqLPlvhd.s_ARCzl3 5iqhOZxkImpSPRuz7VTswS9s673E5npLsBgrJc32BIDNKiPFd0kFLiiljCRr3ldMC.RKZlO2Gv8l N2LGvjmNMo5lpZqkIIGt7LUEMkHNdcGFRsaH3gvPn.fwplXSRIG8JMxTQ_t.wzWnNqiZfEUbyynE 9qGhGs_si3PH3X8eq9MXmHvv8MQ2IySP7ivmOqStnpuT9e9MkhA5EHqwO8zUliUAa9Odc288- Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Mon, 24 Dec 2018 23:38:31 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.109]) ([67.170.167.181]) by smtp408.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 2eddb8c7523f41ae661a90424eeb1d60; Mon, 24 Dec 2018 23:38:29 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: head -r3418363: top -opid process list order is rather odd (top -Saopid example shown) From: Mark Millard In-Reply-To: Date: Mon, 24 Dec 2018 15:38:27 -0800 Cc: FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: References: <6C9BDD8A-7889-4819-86E3-CE13AC3323AC@yahoo.com> To: Yuri Pankov X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: B0F7A716BB X-Spamd-Bar: / X-Spamd-Result: default: False [-0.20 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.91)[ip: (2.49), ipnet: 66.163.184.0/21(1.19), asn: 36646(0.96), country: US(-0.08)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.48)[-0.482,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.72)[0.723,0]; NEURAL_HAM_LONG(-0.84)[-0.840,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[147.187.163.66.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_POSSIBLE(0.00)[147.187.163.66.rep.mailspike.net : 127.0.0.17] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 23:38:42 -0000 On 2018-Dec-24, at 13:49, Yuri Pankov wrote: > Mark Millard wrote: >> =46rom my from=3Dsource head -r3418363 context, top with -opid does = not >> seem to sort in a coherent order, not time of process creation order >> (either direction) and not in just-PID numeric order (either >> direction). For example: >>=20 >> PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU = COMMAND >> 0 root 24 -16 - 0 368K swapin 1 0:00 0.00% = [kernel] >> 16 root 1 -16 - 0 16K - 3 0:00 0.00% = [soaiod2] >> 752 root 1 20 0 18M 18M select 1 0:07 0.01% = /usr/sbin/ntpd -p /var/db/ntp/ntpd.pid -c /etc/ntp.conf -g >> 800 root 1 20 0 11M 908K nanslp 1 0:01 0.00% = /usr/sbin/cron -s >> 1 root 1 20 0 9900K 132K wait 3 0:00 0.00% = [init] >> 17 root 1 -16 - 0 16K - 0 0:00 0.00% = [soaiod3] >> 2 root 1 -16 - 0 16K crypto 0 0:00 0.00% = [crypto] >> 18 root 1 -16 - 0 16K - 0 0:00 0.00% = [soaiod4] >> 850 root 1 20 0 13M 2756K wait 3 0:00 0.00% = login [pam] (login) >> 3 root 1 -16 - 0 16K crypto 0 0:00 0.00% = [crypto returns 0] >> 19 root 1 -16 - 0 16K mmcsd 0 0:25 0.00% = [mmcsd0: mmc/sd card] >> 643 root 1 20 0 11M 1124K select 2 0:01 0.00% = /usr/sbin/syslogd -s >> 4 root 1 -16 - 0 16K crypto 0 0:00 0.00% = [crypto returns 1] >> 20 root 1 -16 - 0 16K mmcsd 0 0:00 0.00% = [mmcsd0boot0: mmc/sd] >> 5 root 1 -16 - 0 16K crypto 0 0:00 0.00% = [crypto returns 2] >> 21 root 1 -16 - 0 16K mmcsd 0 0:00 0.00% = [mmcsd0boot1: mmc/sd] >> 6 root 1 -16 - 0 16K crypto 0 0:00 0.00% = [crypto returns 3] >> 22 root 3 -16 - 0 48K psleep 3 0:12 0.00% = [pagedaemon] >> 5270 root 1 20 0 14M 3780K CPU2 2 0:00 0.14% = top -Saopid >> 662 root 1 20 0 11M 680K select 0 0:00 0.00% = /usr/sbin/rpcbind >> 7 root 2 -16 - 0 32K - 0 0:00 0.00% = [cam] >> 23 root 1 -16 - 0 16K psleep 2 0:00 0.00% = [vmdaemon] >> 5255 root 1 20 0 12M 3092K wait 0 0:00 0.00% = -sh (sh) >> 8 root 1 -16 - 0 16K waitin 0 0:00 0.00% = [sctp_iterator] >> 24 root 3 -16 - 0 48K qsleep 3 0:12 0.01% = [bufdaemon] >> 712 root 1 52 0 12M 616K select 0 0:00 0.00% = /usr/sbin/mountd -r >> 9 root 1 -16 - 0 16K - 1 0:04 0.00% = [rand_harvestq] >> 25 root 1 20 - 0 16K vlruwt 0 0:04 0.00% = [vnlru] >> 10 root 1 -16 - 0 16K audit_ 0 0:00 0.00% = [audit] >> 26 root 1 16 - 0 16K syncer 0 1:45 0.00% = [syncer] >> 714 root 1 52 0 12M 728K select 3 0:00 0.00% = nfsd: master (nfsd) >> 11 root 4 155 ki31 0 64K CPU0 0 144.6H 397.09% = [idle] >> 235 root 1 20 0 11M 564K select 3 0:00 0.00% = dhclient: system.syslog (dhclient) >> 715 root 32 52 0 11M 1120K rpcsvc 3 0:00 0.00% = nfsd: server (nfsd) >> 12 root 18 -52 - 0 288K WAIT 2 2:29 1.43% = [intr] >> 412 root 1 20 0 10M 72K select 2 0:00 0.00% = /sbin/devd >> 796 root 1 52 0 20M 672K select 0 0:00 0.00% = /usr/sbin/sshd >> 13 root 3 -8 - 0 48K - 1 0:11 0.00% = [geom] >> 14 root 20 -68 - 0 320K - 0 0:02 0.00% = [usb] >> 238 root 1 52 0 12M 416K select 1 0:00 0.00% = dhclient: awg0 [priv] (dhclient) >> 15 root 1 -16 - 0 16K - 0 0:00 0.00% = [soaiod1] >> 239 _dhcp 1 20 0 12M 484K select 1 0:00 0.00% = dhclient: awg0 (dhclient) >>=20 >> (Basically the Pine64+ 2GB [aarch64] above was idle after boot other = than >> some runs of top.) >>=20 >> I see this oddity across architectures, for example amd64, powerpc64, >> aarch64, armv7. >=20 > No wonder, it doesn't seem to have worked ever (?) as the compare_pid = is > simply not defined in compares list. Try attached patch. > I'm a long term top user and it used to work. For example, when I was = running head -r340287 it worked as I remember. (I recreated such a vintage = recently for a test of something else. The -opid ordering was coherent as I = remember, unlike the above.) It historically seemed to track the time order of process creation, even = around the PID number wrapping around. (So not a strict PID sort, at least for the PID = shown.) This was handy for monitoring buildworld buidkernel and port builds (all = parallel). I'll probably try the patch when I have a chance, even if it does strict = PID number order. Thanks. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)