*BSD News Article 9085


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA5135 ; Tue, 22 Dec 92 03:01:14 EST
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!menudo.uh.edu!wjin
From: wjin@cs.uh.edu (W. Woody Jin)
Newsgroups: comp.unix.bsd
Subject: Re: Dumb Question: Why 512 byte block?
Date: 18 Dec 1992 18:59:50 GMT
Organization: University of Houston
Lines: 48
Message-ID: <1gt736INNjje@menudo.uh.edu>
References: <1992Dec18.005050.20594@decuac.dec.com> <1992Dec18.030833.7395@fcom.cc.utah.edu>
NNTP-Posting-Host: rodin.cs.uh.edu

In article <1992Dec18.030833.7395@fcom.cc.utah.edu> terry@cs.weber.edu (A Wizard of Earth C) writes:
>In article <1992Dec18.005050.20594@decuac.dec.com>, darryl@vfofu1.dco.dec.com (Darryl Wagoner) writes:
>|> Why is everything in 1/2 k block instead the BSD standard of 1024 byte blocks?
>|> Yes, I know there is a '-k' switch, but it seems to me it should be
>|> the otherway around.
>
>Think of disk blocks as the curve-fitting algoritm they taught you when you
>first learned integral calculus:  the smaller your slices, the closer you
>come to approximating the area under the curve.
>
>If I have a set of 6 512 byte files, I will use up 3K of disk for them;
>similarly, if I had a blocking factor of 1K, I would use of 6K (since the
>smallest fragment usable by a file is now 1K.
>
>If I have 6 1.5K files, this translates to 9K of disk(512B) or 12K of disk(1K).
>Obviously, if I have 6 1.6K files, both blocking factors take up 512K.

I did not think that Fast Unix File System works this way.
If you have 6 1.5K files using 1K blocks,
   6 1k blocks will take each 1K from each file, and 
   3 1k blocks will take 0.5k from each file.
This was my understading from the famous FUFS paper.
   

>The offset into the disk is a _block_offset_; what this means is that you
>will start looking for data at the offet*blocking_size when given an address,
>and that reads/write into kernel cache are done (usually) in block_size
>increments.  A device accessed this way is a blocked device.
>
>When you store a lot of little files on the disk, small blocks are wasteful
>of disk space (for instance, 1024 empty files take 512K vs 1M of disk for
>the smaller blocking factor).

And choosing a disk block size is a performance issue rather than
disk space issue. One should tune disk block size and fragment size
to get the best performance.

I thought that 386BSD uses this Fast Unix File System.

-- 
____   ____  ____ ____________________________________ (___) _________________
|  |   |  |  |  |  W. Woody Jin (wjin@cs.uh.edu)       (o o)      Moo.... 
|  |   |  |__|  |  PhD Student. Research Asst.  o=======\ /  I'm  a Cow Lover.
|  |   |        |  Dept. of Computer Science   / |     ||O   My wife  was born
\  |---|  |--|  |  University of Houston      `  ||'---||    in Cow year. Mooo
 \____/|__|  |__| _______________________________^^    ^^_____________________