*BSD News Article 23415


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!osuunx.ucc.okstate.edu!moe.ksu.ksu.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!psgrain!percy!agora!davidg
From: davidg@agora.rain.com (David Greenman)
Subject: Re: [FreeBSD 1.0e] Kernel's bss has grown up
Message-ID: <CG3Ivw.KAA@agora.rain.com>
Organization: Open Communications Forum
Date: Sun, 7 Nov 1993 00:33:31 GMT
Lines: 34

Charles Hannum says...
>very twisted sense of what the word `dynamic' means.  Buffers are
>allocated as file system usage occurs, but they are never freed.  This
>is roughly the same code as 386BSD 0.1.
>
>NetBSD-current doesn't attempt to be pretentious at all about this,
>and simply allocates the buffers statically.  For reasons I won't get
>into, this reduces kernel memory map fragmentation and gives better
>reuse of buffer space.  (Using 8k/1k file systems under FreeBSD is
>likely to cause Hell, as it did under 386BSD, for example.)

   You are correct up until the last statement.

   Your assertion that 8k block filesystems will "cause hell" as it
did under 386BSD is wrong.
   The reason is simple, we dramatically increased the virtual memory that is
available to the malloc code (it is now 16MB of virtual address space), and it
can be proven mathematically that, given the way that malloc is used, it is
impossible for fragmentation to become a problem.

It's simple:

   The limit of FS buffers is 6.7MB. Use of the malloc region by things other
than the FS cache never exceeds about 1.2MB. Worst-case fragmentation is
when there is a free page followed by an in-use page (this is because if
there were two free pages in between an inuse page, this would be 8k and
therefore not a problem). Given worst-case fragmentation, this could consume
as much as 2.4MB of virtual address space. Now, the FS buffers are specifically
limited to 6.7MB, and the worst-case virtual consumption of this is 13.4MB.
13.4+2.4 = 15.8MB. This assumes that you are mixing 4k and 8k filesystems. If
you aren't, then the numbers come out even better.


-DG