From owner-freebsd-hackers@FreeBSD.ORG Wed May 26 18:52:54 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22BBD1065672 for ; Wed, 26 May 2010 18:52:54 +0000 (UTC) (envelope-from yanefbsd@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 CD9DC8FC12 for ; Wed, 26 May 2010 18:52:53 +0000 (UTC) Received: by qyk11 with SMTP id 11so9997163qyk.13 for ; Wed, 26 May 2010 11:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=hB8xZH3zcHHfCJ6weTeMW7cJ5piGmH+z+PZzUlC/Erw=; b=G2r2MnrtK5NmB76I98YAoeJCc+WYwj2fSNoMbmG9qc05zrOtFoJL6lgkBc6dUfy7zR EfoLldxlje8I5HzUBEy7gioR2o/7bre5qUWqGqlRrsXHEIHxtfbPSpu3gUQ+uelHo2g7 hTD3TYVtrxlZ4Q0H/19Dwlak/AEvwLCWZw/cU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=OCMTryp4xbUMflBY2Tat1wNz0oWsme/ufkLONqHL1MPVTy9UN4hUeLIfNLaKT+DpZf V6fOVb7L1wwGN64E6knDj9NwHgmTICoWPtZOlEP8ORPYQCEZmQWwPIhcOtW+vq0Jg0RO lvuf+iyYFfuGIxDjpdKDAeot51bDHHQ1cNTIo= MIME-Version: 1.0 Received: by 10.224.58.78 with SMTP id f14mr5099480qah.385.1274899971952; Wed, 26 May 2010 11:52:51 -0700 (PDT) Received: by 10.229.190.83 with HTTP; Wed, 26 May 2010 11:52:51 -0700 (PDT) In-Reply-To: References: <1274739973.31299.23.camel@localhost.localdomain> <4BFBD838.40208@dataix.net> <4BFC1660.1000405@dataix.net> Date: Wed, 26 May 2010 11:52:51 -0700 Message-ID: From: Garrett Cooper To: jhell Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers , sbruno@freebsd.org, Sean Bruno Subject: Re: Exposing Zone Sleeps X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2010 18:52:54 -0000 On Wed, May 26, 2010 at 11:51 AM, Garrett Cooper wrote= : > On Tue, May 25, 2010 at 11:26 AM, jhell wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> On 05/25/2010 10:01, jhell wrote: >>> On 05/24/2010 18:26, Sean Bruno wrote: >>>> Find attached a patch against -CURRENT. >>> >>>> This update exposes a counter that indicates the number of times that = we >>>> sleep when attempting to allocate a slab from the keg. =A0In other wor= ds, >>>> the number of times we BLOCK and wait, which is bad. >>> >>>> This allows differentiation between times when we failed to allocate a= nd >>>> it was ok and times where we were forced to sleep. =A0The current FAIL >>>> counter does not make this distinction. >>> >>>> Exposes this information via uma_zone_t->uz_sleeps. >>> >>>> Add a new sysctl to retrieve this information. >>>> Enhance vmstat -z to retrieve this information. >>> >>>> We've found this *extremely* useful here at Yahoo in the past and woul= d >>>> like to commit this if it is acceptable. >>> >>>> Tested on 32bit and 64bit architectures on 6/7/CURRENT. >>> >>> >>> Hi Sean, >>> >>> Nice work on this. I applied this to stable/8 r208530 and I am in the >>> process of compiling the kernel right now. Everything else has built & >>> runs as expected "i386". Attached is the adjusted patch which was one >>> modification to the line number for uz_sleeps in sys/vm/uma_int.h. >>> >>> 8 files changed, 106 insertions(+), 7 deletions(-) >>> >>> For those wishing to apply this patch and test for them self: >>> >>> cd /usr/src >>> patch >> cd /usr/src/include >>> make obj && make depend && make includes && make install >>> cd /usr/src/lib/libmemstat >>> make obj && make depend && make includes && make install >>> cd /usr/src/usr.bin/vmstat >>> make obj && make depend && make install >>> cd /usr/src >>> make kernel KERNCONF=3DYOUR_KERN_CONF >>> reboot >>> >>> Can't wait to see some results from this & I will report back with >>> either negative results of the build & run or positive results from the >>> stats collected. >>> >>> If there is anything needed feel free to let me know and I will do what >>> is possible ASAP. >>> >>> Thanks again, >>> >> >> This patch instead pardon the early.post but there was a problem with >> the last patch that I attached for stable/8 r208530 with arguments 10 & >> 11 to function sysctl_vm_zone where it wanted a long unsigned integer >> rather than u_int64_t. >> >> This patch satisfies that. Whether its correct is left to the reader but >> compiles cleanly & runs smoothly. > > I know this seems trivial, but could you change: > > + =A0 =A0 =A0 printf("%-20s %6s %6s %8s %8s %8s %4s %4s\n\n", "ITEM", "SI= ZE", > + =A0 =A0 =A0 =A0 =A0 "LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP"); > > to > > + =A0 =A0 =A0 printf("%-20s %6s %6s %8s %8s %8s %4s %4s\n\n", "ITEM", "SI= ZE", > + =A0 =A0 =A0 =A0 =A0 "LIMIT", "USED", "FREE", "REQS", "FAIL", "SLEEP"); > > that way the plural nature of requests is more straightforward and unders= tood. > > Also, do all of the fields _really_ need to have a field width? Seems > like overkill to me... Oh, and the field width for the last item is wrong; SLEEP will be truncated to SLEE. Thanks, -Garrett