From owner-svn-src-head@FreeBSD.ORG Wed Oct 17 15:04:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE4293AB; Wed, 17 Oct 2012 15:04:54 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id DA1998FC18; Wed, 17 Oct 2012 15:04:53 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id 16so6068989wgi.31 for ; Wed, 17 Oct 2012 08:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=pYkewBOGkz9Hn49kXhmWDu65oi/S6dRYHtGwDN7CNnY=; b=RT+S7gKdI878MPNMnKH/i/gGcKN2KnPbJmunO7bp7Rzog34qJDXIW+8F2kZ8JtQc5v EQT/H833hD+vh/MopcnpzUNYZg9+CqiWp53iyj1rtFRiFityVXwWd5RJKDg0J5DHQizD c/wSqKaGHd/7rsNdVSii/WtwR89KNSlO6QQAr7494T3FDhZI1dIUJylWAhNacw7TGyyF 8PpPajrA3J5ArXAd7yCMNmTRexcthwG89B8Yq7fPwwNMvbKevPG7ISXg5APKSr40In9x FChIaS6GX00TCOt+7xac0CX6q5/G9EK3b/e8ztPh0267WapNnKAKnArUEZunMU2NuWMC qJqw== Received: by 10.180.100.35 with SMTP id ev3mr4769862wib.7.1350486293033; Wed, 17 Oct 2012 08:04:53 -0700 (PDT) Received: from ndenevsa.sf.moneybookers.net (g1.moneybookers.com. [217.18.249.148]) by mx.google.com with ESMTPS id p4sm28026361wix.0.2012.10.17.08.04.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 08:04:52 -0700 (PDT) Subject: Re: svn commit: r237656 - in head: contrib/top usr.bin/top Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\)) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <201206271808.q5RI8m0d024853@svn.freebsd.org> Date: Wed, 17 Oct 2012 18:04:47 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <38E42006-48A5-4AF7-9892-EB81583FE5A9@gmail.com> References: <201206271808.q5RI8m0d024853@svn.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1498) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 17 Oct 2012 15:04:55 -0000 On Jun 27, 2012, at 9:08 PM, John Baldwin wrote: > Author: jhb > Date: Wed Jun 27 18:08:48 2012 > New Revision: 237656 > URL: http://svn.freebsd.org/changeset/base/237656 >=20 > Log: > Add a new line to top that provides a brief summary of the ZFS ARC = memory > usage on hosts using ZFS. The new line displays the total amount of = RAM > used by the ARC along with the size of MFU, MRU, anonymous (in = flight), > headers, and other (miscellaneous) sub-categories. The line is not > displayed on systems that are not using ZFS. >=20 > Reviewed by: avg, fs@ > MFC after: 3 days >=20 > Modified: > head/contrib/top/display.c > head/contrib/top/layout.h > head/contrib/top/machine.h > head/contrib/top/top.c > head/usr.bin/top/machine.c > head/usr.bin/top/top.local.1 >=20 >=20 > Modified: head/usr.bin/top/machine.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/top/machine.c Wed Jun 27 17:51:09 2012 = (r237655) > +++ head/usr.bin/top/machine.c Wed Jun 27 18:08:48 2012 = (r237656) > @@ -176,6 +176,12 @@ char *memorynames[] =3D { > "K Free", NULL > }; >=20 > +int arc_stats[7]; > +char *arcnames[] =3D { > + "K Total, ", "K MRU, ", "K MFU, ", "K Anon, ", "K Header, ", "K = Other", > + NULL > +}; > + >=20 > + if (arc_enabled) { > + GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); > + arc_stats[0] =3D arc_stat >> 10; > + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); > + arc_stats[1] =3D arc_stat >> 10; > + GETSYSCTL("vfs.zfs.mru_size", arc_stat); > + arc_stats[2] =3D arc_stat >> 10; > + GETSYSCTL("vfs.zfs.anon_size", arc_stat); > + arc_stats[3] =3D arc_stat >> 10; > + GETSYSCTL("kstat.zfs.misc.arcstats.hdr_size", arc_stat); > + GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", = arc_stat2); > + arc_stats[4] =3D arc_stat + arc_stat2 >> 10; > + GETSYSCTL("kstat.zfs.misc.arcstats.other_size", = arc_stat); > + arc_stats[5] =3D arc_stat >> 10; > + si->arc =3D arc_stats; > + } > + =20 Hi, It looks like MFU and MRU are swapped in top's display. I'm using this to correct the output: --- /usr/src/.zfs/snapshot/patches/usr.bin/top/machine.c = 2012-09-26 08:20:26.000000000 +0200 +++ usr.bin/top/machine.c 2012-10-17 17:00:14.988895167 +0200 @@ -515,9 +515,9 @@ if (arc_enabled) { GETSYSCTL("kstat.zfs.misc.arcstats.size", arc_stat); arc_stats[0] =3D arc_stat >> 10; - GETSYSCTL("vfs.zfs.mfu_size", arc_stat); - arc_stats[1] =3D arc_stat >> 10; GETSYSCTL("vfs.zfs.mru_size", arc_stat); + arc_stats[1] =3D arc_stat >> 10; + GETSYSCTL("vfs.zfs.mfu_size", arc_stat); arc_stats[2] =3D arc_stat >> 10; GETSYSCTL("vfs.zfs.anon_size", arc_stat); arc_stats[3] =3D arc_stat >> 10;