From owner-freebsd-current@FreeBSD.ORG Wed Aug 11 15:43:24 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7511C16A4CE for ; Wed, 11 Aug 2004 15:43:24 +0000 (GMT) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id B285B43D53 for ; Wed, 11 Aug 2004 15:43:23 +0000 (GMT) (envelope-from andre@freebsd.org) Received: (qmail 91401 invoked from network); 11 Aug 2004 15:37:20 -0000 Received: from dotat.atdotat.at (HELO [62.48.0.47]) ([62.48.0.47]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 11 Aug 2004 15:37:20 -0000 Message-ID: <411A3E9A.6000301@freebsd.org> Date: Wed, 11 Aug 2004 17:43:22 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040608 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bosko Milekic References: <20040811152950.GA17794@freefall.freebsd.org> In-Reply-To: <20040811152950.GA17794@freefall.freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-current@freebsd.org Subject: Re: UMA questions X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Wed, 11 Aug 2004 15:43:24 -0000 Bosko Milekic wrote: >>1. UMA zones do not show up in the output of 'vmstat -m'. Is there a way >> to get information on how much memory each UMA zone is using? >> Example: "sackhole", "tcptw", ... > > > vmstat -z, or sysctl vm.zone. Be careful when interpreting the stats > in the Mbuf, Mbuf Cluster, and Packet zones, because they are special. > See www.unixdaemons.com/~bmilekic/netbuf_bmilekic.pdf if you want to > know why, exactly. Great, thanks for the pointer. >>2. What does the flag UMA_ZONE_ZINIT do exactly? > > > It initializes zone-allocated objects to zero. This happens as objects > are first allocated (i.e., slabs are allocated) and before placement > into the slab cache. Unfortunately, I am not sure this works very well > unless you also make sure to zero them as they are returned (dtor), > which is a shitty model. Ok, so it is better to use uma_zalloc(zone, M_ZERO)? >>3. What does the flag UMA_ZONE_NOFREE prevent exactly? Will it prevent any >> zone/slab of this type to be free'd ever again? This way the zone can >> only grow and not shrink after transient peaks? > > Yes. It prevents freeing/draining of the slab cache. Usually not what one wants. Most of the time we want to give free slabs back if under memory pressure. >4. What does the flag UMA_ZONE_STATIC do exactly? I was under the impression >> that zones are fixed sized by definition and don't need this to be >> specified additionally. > > It does nothing. Many thanks for your quick answers. Would you mind documenting this in the uma_* manpages? Or someone from doc team? -- Andre