From owner-freebsd-arch Mon Feb 17 4:24:44 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B67F37B401 for ; Mon, 17 Feb 2003 04:24:42 -0800 (PST) Received: from tesla.distributel.net (nat.MTL.distributel.NET [66.38.181.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id B866643FB1 for ; Mon, 17 Feb 2003 04:24:41 -0800 (PST) (envelope-from bmilekic@unixdaemons.com) Received: (from bmilekic@localhost) by tesla.distributel.net (8.11.6/8.11.6) id h1HCOKV64292; Mon, 17 Feb 2003 07:24:20 -0500 (EST) (envelope-from bmilekic@unixdaemons.com) Date: Mon, 17 Feb 2003 07:24:20 -0500 From: Bosko Milekic To: Jeff Roberson Cc: freebsd-arch@FreeBSD.ORG Subject: Re: mb_alloc cache balancer / garbage collector Message-ID: <20030217072420.A64237@unixdaemons.com> References: <20030216213552.A63109@unixdaemons.com> <20030217052758.E85957-100000@mail.chesapeake.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030217052758.E85957-100000@mail.chesapeake.net>; from jroberson@chesapeake.net on Mon, Feb 17, 2003 at 05:29:18AM -0500 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Feb 17, 2003 at 05:29:18AM -0500, Jeff Roberson wrote: > > On Sun, 16 Feb 2003, Bosko Milekic wrote: > > > > > I've finally gotten around to implementing the cache balancer/garbage > > collector for the mbuf allocator. Actually, it's been sitting in a > > local tree for a while but I finally got one of my -CURRENT machines > > back up and was able to debug it. > > > > Bosko, this is great stuff. This leads me to wonder though, are we ever > going to unify mb alloc and uma? It seems that it would make sense to do > so. If the performance is not as good with UMA then it may make sense to > keep mb_alloc. Especially now that it can reclaim memory. Have you > looked at catching the low memory callback to drain your caches? I looked at unifying the allocator but there are several problems that make doing it pretty tough. One of these is the optimizations that we perform in mb_alloc. Notably, mbufs and mbuf clusters share the same cache lock. Also, I have routines that are able to allocate an mbuf and a cluster in one shot in one function call without dropping the cache lock in between. Similarily, m_getm() can allocate a large number of mbufs and clusters in one shot without - in the best and hopefully common case - dropping any cache lock in between. Although UMA is really good, from looking at it I doubt that I would be able to make these kinds of optimizations without ripping into/outof it pretty hard. > Cheers, > Jeff -- Bosko Milekic * bmilekic@unixdaemons.com * bmilekic@FreeBSD.org "If we open a quarrel between the past and the present, we shall find that we have lost the future." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message