From owner-freebsd-hackers Thu Jul 26 0:37:45 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from web5301.mail.yahoo.com (web5301.mail.yahoo.com [216.115.106.110]) by hub.freebsd.org (Postfix) with SMTP id 5931637B405 for ; Thu, 26 Jul 2001 00:37:40 -0700 (PDT) (envelope-from vishubp@yahoo.com) Message-ID: <20010726073740.5662.qmail@web5301.mail.yahoo.com> Received: from [203.200.20.3] by web5301.mail.yahoo.com via HTTP; Thu, 26 Jul 2001 08:37:40 BST Date: Thu, 26 Jul 2001 08:37:40 +0100 (BST) From: =?iso-8859-1?q?vishwanath=20pargaonkar?= Subject: Re: cluster size To: Julian Elischer , Zhihui Zhang Cc: Bosko Milekic , Terry Lambert , vishwanath pargaonkar , freebsd-hackers@FreeBSD.ORG In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, lets come to my question please. tell me can i change mbuf cluster size from 2048 to 4096?? how shd i do it if i can do it? --- Julian Elischer wrote: > no.. it has to do with the fact that it would be > unwise > to make a cluster > 1 page size since we have no > guarantee that > all drivers could handle breaking up a DMA if a > cluster spanned 2 > physical address ranges. (they can handle a chain of > discontinuous > mbufs but may assume that a single mbuf will have > physically > contiguous data. Now since we cannot span a page > boundary, > we should fit in exacly to get as much room as > possible > and since (pagesize/3) is too small, the next > possibility is (pagesize/2). > > If pagesize/3 was big enough, we might have used > that.. > > > On Wed, 25 Jul 2001, Zhihui Zhang wrote: > > > > > I see. It has something to do with the > power-of-two allocator we are > > using inside the kernel. > > > > -Zhihui > > > > On Wed, 25 Jul 2001, Bosko Milekic wrote: > > > > > > > > On Wed, Jul 25, 2001 at 01:51:51PM -0400, Zhihui > Zhang wrote: > > > > > > > > > > > > On Tue, 24 Jul 2001, Terry Lambert wrote: > > > > > > > > > Zhihui Zhang wrote: > > > > > > > Hi, > > > > > > > in freebsd can we change the cluster > size from 2048 > > > > > > > bytes.If yes how can we do that? > > > > > > > do we have to configure in some file? > > > > > > > > > > > > You must be asking why the mbuf cluster > size is chosen as 2048, right? It > > > > > > is probably a tradeoff between memory > efficient and speed. > > > > > > > > > > Ask yourselves: > > > > > > > > > > "What is the minimum cluster size I would > have to have > > > > > to be able to contain the maximum MTU > worth of data, > > > > > yet remain an even multiple of > sizeof(mbuf) -- 256 > > > > > bytes?" > > > > > > > > A dumb question: why even not odd multiple? > > > > > > > > -Zhihui > > > > > > It actually has to do with the fact that 2K is > the only size equal to > > > or greater than the maximum MTU worth of data > that can be multiplied to a page > > > size without any leftover (in other words, page > size modulo 2K is zero). > > > > > > -- > > > Bosko Milekic > > > bmilekic@technokratis.com > > > > > > > > > To Unsubscribe: send mail to > majordomo@FreeBSD.org > > > with "unsubscribe freebsd-hackers" in the body > of the message > > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-hackers" in the body of > the message > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message