From owner-freebsd-net Tue Mar 4 14:39:45 2003 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 35D8937B401; Tue, 4 Mar 2003 14:39:44 -0800 (PST) Received: from tesla.distributel.net (nat.MTL.distributel.NET [66.38.181.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51FB543F85; Tue, 4 Mar 2003 14:39:43 -0800 (PST) (envelope-from bmilekic@unixdaemons.com) Received: (from bmilekic@localhost) by tesla.distributel.net (8.11.6/8.11.6) id h24Mc9D10411; Tue, 4 Mar 2003 17:38:09 -0500 (EST) (envelope-from bmilekic@unixdaemons.com) Date: Tue, 4 Mar 2003 17:38:09 -0500 From: Bosko Milekic To: Petri Helenius Cc: freebsd-current@FreeBSD.ORG, freebsd-net@FreeBSD.ORG Subject: Re: mbuf cache Message-ID: <20030304173809.A10373@unixdaemons.com> References: <0ded01c2e295$cbef0940$932a40c1@PHE> <20030304164449.A10136@unixdaemons.com> <0e1b01c2e29c$d1fefdc0$932a40c1@PHE> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <0e1b01c2e29c$d1fefdc0$932a40c1@PHE>; from pete@he.iki.fi on Wed, Mar 05, 2003 at 12:24:27AM +0200 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, Mar 05, 2003 at 12:24:27AM +0200, Petri Helenius wrote: > > > > Yes, it's normal. The commit log clearly states that the new > > watermarks do nothing for now. I have a patch that changes that but I > > haven't committed it yet because I left for vacation last Sunday and I > > only returned early this Monday. Since then, I've been too busy to > > clean up and commit it. In about a week or so you should notice a > > difference. > > > Any comments on the high cpu consumption of mb_free? Or any other places > where I should look to improve performance? What do you mean "high cpu consumption?" The common case of mb_free() is this: bucket = mb_list->ml_btable[MB_BUCKET_INDX(m, mb_list)]; owner = bucket->mb_owner & ~MB_BUCKET_FREE; switch (owner) { ... default: cnt_lst = MB_GET_PCPU_LIST_NUM(mb_list, owner); MB_PUT_OBJECT(m, bucket, cnt_lst); MB_MBTYPES_DEC(cnt_lst, type, 1); if (bucket->mb_owner & MB_BUCKET_FREE) { SLIST_INSERT_HEAD(&(cnt_lst->mb_cont.mc_bhead), bucket, mb_blist); bucket->mb_owner = cnt_lst->mb_cont.mc_numowner; } } That's the common path, modulo a couple checks on whether or not the container being freed to needs to be moved or whether we're in a starvation situation. The only thing to be done, possibly, is make the routine smaller by moving those couple of actions to seperate routines, but I'm not clear that this is very useful, given that mb_free()'s usage is restricted to only inside subr_mbuf.c > Pete -- Bosko Milekic * bmilekic@unixdaemons.com * bmilekic@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message