From owner-freebsd-net Thu Jul 11 14: 1: 5 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 3B2CD37B400 for ; Thu, 11 Jul 2002 14:00:59 -0700 (PDT) Received: from smtp.uc3m.es (smtp01.uc3m.es [163.117.136.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 804AE43E3B for ; Thu, 11 Jul 2002 14:00:58 -0700 (PDT) (envelope-from jrh@lab.it.uc3m.es) Received: from smtp01.uc3m.es (localhost [127.0.0.1]) by smtp.uc3m.es (Postfix) with ESMTP id 9874343142; Thu, 11 Jul 2002 23:00:57 +0200 (CEST) Received: from itserv2.lab.it.uc3m.es (itserv2.lab.it.uc3m.es [163.117.144.121]) by smtp01.uc3m.es (Postfix) with ESMTP id 33DC299E03; Thu, 11 Jul 2002 23:00:57 +0200 (CEST) Received: from lm011.lab.it.uc3m.es (root@lm011.lab.it.uc3m.es [163.117.144.140]) by itserv2.lab.it.uc3m.es (8.9.3/8.9.3) with ESMTP id XAA05748; Thu, 11 Jul 2002 23:00:57 +0200 Received: from localhost (jrh@localhost) by lm011.lab.it.uc3m.es (8.9.3/8.9.3/Debian 8.9.3-21) with SMTP id XAA22340; Thu, 11 Jul 2002 23:00:56 +0200 Date: Thu, 11 Jul 2002 23:00:56 +0200 (CEST) From: Juan Francisco Rodriguez Hervella To: Luigi Rizzo Cc: Bosko Milekic , freebsd-net@FreeBSD.ORG Subject: Re: mbuf external buffer reference counters In-Reply-To: <20020711133802.A31827@iguana.icir.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Thu, 11 Jul 2002, Luigi Rizzo wrote: > Hi, > > certainly removing the malloc will improve performance a lot. > > As I already mentioned to Bosko, in principle the available area > in ext.buffers is irrelevant, and i do not believe this will break > anything (and if it does, it will be easy to fix in the kernel), > but some applications might decide to do writes in multiple of 1K > and trimming away the refcount area might easily result in suboptimal > allocation of storage within the kernel. > First of all, let me say that Im newbie with these topics, I only know a bit about mbufs, but I dont understand how can an application trim away the refcount if the size is MCLBYTES = 2040 - sizeof(refcount). Don't this limit the room which an app. can write ? Thanks. JFRH > I'd probably try to use the same technique as -stable (i.e. have > a separate array for all refcounts), if that is not too bad > from other points of view. > > cheers > luigi > > On Thu, Jul 11, 2002 at 04:20:26PM -0400, Bosko Milekic wrote: > > > > 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 > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message