Subject: Re: improvements to mknod(8)
To: David Laight <david@l8s.co.uk>
From: Luke Mewburn <lukem@netbsd.org>
List: tech-userlevel
Date: 02/10/2003 09:36:46
On Sun, Feb 09, 2003 at 08:42:38PM +0000, David Laight wrote:
  | Some timings for my 50MHz sparc running diskless.
  | 
  | issue:		92.03s real    25.27s user    50.80s system
  | mtree:		18.30s real     5.61s user    10.83s system
  | mknod:		93.13s real    33.60s user    55.11s system
  | 
  | The above are all running all control structure of MAKEDEV.
  | The latter two have all the chown/chgrp/chmod/rm calls removed
  | and replaced with lines like:
  | 	$mk ./kmem type=char device=netbsd,3,1 mode=640 gname=kmem
  | where $mk is either echo (mtree case) or the name of a shell
  | function that will run:
  | 	mknod -f -m 640 -g kmem kmem c 3 1
  | in the above case.
  | (the -f is 'force'...)
  | 
  | I can't guess why the 'issue' is faster than my version!
  | I'm runnign a lot less programs.  Slightly more shell, but that
  | shouldn't up the 'system' time.
  | My guess has something to do with the uname/gname lookup code...

It is unclear to me (early in the morning, coffee not affecting
neurons yet), what you're timing there.  What is "issue", "mtree",
and "mknod"  referenced in your examples?


Note; the reason that the install media uses the mfs trick instead of
just "stuffing" the devices into the ramdisk is that /dev in the
latter case consumes a lot of inodes and the ramdisk runs out of
space (e.g, 2000 inodes on a 3MB file system).