From owner-freebsd-fs@FreeBSD.ORG Wed Apr 21 13:04:41 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B7281065679 for ; Wed, 21 Apr 2010 13:04:41 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id F26F08FC13 for ; Wed, 21 Apr 2010 13:04:40 +0000 (UTC) Received: by qyk11 with SMTP id 11so8113933qyk.13 for ; Wed, 21 Apr 2010 06:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=SGgVBKGBXlEdUgrACQW+22rW/kZ/yvjPl0eFMmCdq7Q=; b=t968tDLwK4b3tZn98JPB6x/g0iXNaISNh4ES4DbYftGO9a5PAiKxZNhjxLWcRJPCHS gbwR7iwPW/2B0EYaut5DsCzYWoahDtOnbxlYLWrlw19DLBCohVS8F6I8Tk1qtlwMPsrw FYpRW9PcxcqE+sTAXjZu83lJ4amxT9JI4+z0w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=wfNm3WxC3WenEE3SqMm8yCn4+b1l6nxaXbYXMT9IFbkkmwB6ietn36AmK28JwVMM0V HlVEmHFmR71h5uMzVWWKEETIm0goMnTGQCIKx2m/uobuNSCXxJstslWWPT0FrSZuTBZq Y+82T2X7mBudDwJH5X28xdJmRIfRB0dEAjigM= Received: by 10.224.14.18 with SMTP id e18mr2756320qaa.99.1271855080020; Wed, 21 Apr 2010 06:04:40 -0700 (PDT) Received: from centel.dataix.local (c-71-205-129-194.hsd1.mi.comcast.net [71.205.129.194]) by mx.google.com with ESMTPS id 7sm2317134qwb.44.2010.04.21.06.04.38 (version=SSLv3 cipher=RC4-MD5); Wed, 21 Apr 2010 06:04:38 -0700 (PDT) Sender: "J. Hellenthal" Message-ID: <4BCEF7E4.6080606@dataix.net> Date: Wed, 21 Apr 2010 09:04:36 -0400 From: jhell User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100331 Thunderbird/3.0.4 MIME-Version: 1.0 To: Andriy Gapon References: <4BC86CF3.7060708@icyb.net.ua> In-Reply-To: <4BC86CF3.7060708@icyb.net.ua> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org Subject: Re: some arc_reclaim_needed stats X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2010 13:04:41 -0000 On 04/16/2010 09:58, Andriy Gapon wrote: > > I added some statistics gathering code to arc_reclaim_needed (see a diff below) > and got these results: > > vfs.zfs.arc_reclaim_kmem_used: 192 > vfs.zfs.arc_reclaim_paging_target: 72505 > vfs.zfs.arc_reclaim_pages_needed: 17 > vfs.zfs.arc_reclaim_arc_c_max: 150 > vfs.zfs.arc_reclaim_needfree: 1693 > > Are these numbers useful in any way? :-) > What do they tell? > Perhaps vm_paging_target() check is a bit too aggressive? > > Thanks! > > > diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > index ca8ffb1..6db69e1 100644 > --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > @@ -2040,6 +2040,24 @@ arc_shrink(void) > > static int needfree = 0; > > +static int arc_reclaim_needfree = 0; > +static int arc_reclaim_arc_c_max = 0; > +static int arc_reclaim_pages_needed = 0; > +static int arc_reclaim_paging_target = 0; > +static int arc_reclaim_kmem_used = 0; > + > +SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_reclaim_needfree, CTLFLAG_RD, > + &arc_reclaim_needfree, 0, "Later"); > +SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_reclaim_arc_c_max, CTLFLAG_RD, > + &arc_reclaim_arc_c_max, 0, "Later"); > +SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_reclaim_pages_needed, CTLFLAG_RD, > + &arc_reclaim_pages_needed, 0, "Later"); > +SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_reclaim_paging_target, CTLFLAG_RD, > + &arc_reclaim_paging_target, 0, "Later"); > +SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_reclaim_kmem_used, CTLFLAG_RD, > + &arc_reclaim_kmem_used, 0, "Later"); > + > +/* XXX AVG ZFS BOOKMARK */ > static int > arc_reclaim_needed(void) > { > @@ -2048,10 +2066,14 @@ arc_reclaim_needed(void) > #endif > > #ifdef _KERNEL > - if (needfree) > + if (needfree) { > + arc_reclaim_needfree++; > return (1); > - if (arc_size > arc_c_max) > + } > + if (arc_size > arc_c_max) { > + arc_reclaim_arc_c_max++; > return (1); > + } > if (arc_size <= arc_c_min) > return (0); > > @@ -2059,8 +2081,14 @@ arc_reclaim_needed(void) > * If pages are needed or we're within 2048 pages > * of needing to page need to reclaim > */ > - if (vm_pages_needed || (vm_paging_target() > -2048)) > + if (vm_pages_needed) { > + arc_reclaim_pages_needed++; > + return (1); > + } > + if ((vm_paging_target() > -2048)) { > + arc_reclaim_paging_target++; > return (1); > + } > > #if 0 > /* > @@ -2105,8 +2133,10 @@ arc_reclaim_needed(void) > return (1); > #endif > #else > - if (kmem_used() > (kmem_size() * 3) / 4) > + if (kmem_used() > (kmem_size() * 3) / 4) { > + arc_reclaim_kmem_used++; > return (1); > + } > #endif > > #else > Hi Andriy, If these are not tunable values and serve a good purpose as a stat to be added at some point, would they not be better in kstat.zfs.misc? rather than vfs.zfs so they can be collected with the rest of the stats via arc_summary.pl. Without seeing the thread "kstat.zfs.misc.arcstats.hash_collisions" I had updated the arc_summary.pl script yesterday to include these under a "ARC Misc" section in the output. Just a FYI in case it may be useful to you or others. Thanks PS: Not a must, but anything that is ZFS (k)stats related I would appreciate greatly being CC'd so I can properly track the improvements and adjust the arc_summary.pl script appropriately. Regards, -- http://jhell.googlecode.com/files/arc_summary.pl (r59) jhell