From owner-freebsd-hackers@freebsd.org Wed Nov 25 02:27:07 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4796AA37F31 for ; Wed, 25 Nov 2015 02:27:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25F7C109B; Wed, 25 Nov 2015 02:27:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 19B96B98F; Tue, 24 Nov 2015 21:27:06 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Cc: Ian Lepore , freebsd-hackers Subject: Re: vmstat -m strangeness Date: Tue, 24 Nov 2015 17:10:19 -0800 Message-ID: <1769220.C3nP8qXIrX@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <1445378386.14127.2.camel@freebsd.org> References: <1445378386.14127.2.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 24 Nov 2015 21:27:06 -0500 (EST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2015 02:27:07 -0000 On Tuesday, October 20, 2015 03:59:46 PM Ian Lepore wrote: > root@wand:~ # vmstat -m | egrep "busdma|bounce|devbuf|Type" > Type InUse MemUse HighUse Requests Size(s) > devbuf 125 10K - 166 16,32,64,256,512,1024 > busdma 922 116K - 922 128 > bounce 385 775K - 385 32,128 > > How do 385 allocations of 32 or 128 bytes add up to 775K? The > answer... 768K of individual pages each allocated via contigmalloc() do > n't show up in that output. Why is that, and is it something that > should be fixed? Hmm. The output is "correct", it's just that these small allocations have relatively high overhead (PAGE_SIZE - 32 for a 32 byte allocation, etc.). Not sure if there's a way to explain (in vmstat output) why the overhead for certain malloc buckets is so high. Perhaps the vmstat(8) manpage could be expanded to explain what MemUse is and list the contigmalloc() case explicitly as one possible reason for high overhead? -- John Baldwin