From owner-freebsd-net Thu Jul 11 13:20:52 2002 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 CF3AD37B400 for ; Thu, 11 Jul 2002 13:20:48 -0700 (PDT) Received: from tesla.distributel.net (nat.MTL.distributel.NET [66.38.181.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 105B643E09 for ; Thu, 11 Jul 2002 13:20:48 -0700 (PDT) (envelope-from bmilekic@unixdaemons.com) Received: (from bmilekic@localhost) by tesla.distributel.net (8.11.6/8.11.6) id g6BKKQa18732 for freebsd-net@freebsd.org; Thu, 11 Jul 2002 16:20:26 -0400 (EDT) (envelope-from bmilekic@unixdaemons.com) Date: Thu, 11 Jul 2002 16:20:26 -0400 From: Bosko Milekic To: freebsd-net@freebsd.org Subject: mbuf external buffer reference counters Message-ID: <20020711162026.A18717@unixdaemons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i 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 Hi, Right now, in -CURRENT, there is this hack that I introduced that basically just allocates a ref. counter for external buffers attached to mbufs with malloc(9). What this means is that if you do something like allocate an mbuf and then a cluster, there's a malloc() call that is made to allocate a small (usually 4-byte) reference counter for it. That sucks, and even -STABLE doesn't do this. I changed it this way a long time ago for simplicity's sake and since then I've been meaning to do something better here. The idea was, for mbuf CLUSTERS, to stash the counter at the end of the 2K buffer area, and to make MCLBYTES = 2048 - sizeof(refcount), which should be more than enough, theoretically, for all cluster users. This is by far the easiest solution (I had it implemented about 10 months ago) and it worked great. The purpose of this Email is to find out if anyone has concrete information on why this wouldn't work (if they think it wouldn't). So, if someone has an example of some broken code somewhere that wouldn't like this, please point it out to me now before I go off and do this again and commit it. Thanks, -- 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