Subject: results from playing around with the new dirpref code
To: None <tech-perform@netbsd.org>
From: Luke Mewburn <lukem@wasabisystems.com>
List: tech-perform
Date: 09/03/2001 19:33:08
--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
i've ported the new dirpref code (as seen in freebsd & openbsd) to
netbsd-current, and gotten some interested results.
i've attached some benchmark output, as well as the program i used to
test it. the test program was changed after the initial run on the old
dirpref code, because i noticed that the umount after rm of a softdep
partition was taking a significant amount of time. the test tarfile -
pkgsrc.tar.gz - contains 52000 files, so that's why i did separate
tests with NVNODES bumped to 80000 (from ~ 25000)
the `disk 1' results are from a file system with > 19000 cylinder groups
(it was left over from my testing of the fs_csp[] fix recently
committed :), and that really triggers some pathological results
in the ffs code.
the `disk 2' results are from a more `normal' file system.
it appears that with the existing ffs_dirpref() routine (as fixed by
bill sommerfeld earlier this year to remove some of the really
pathological corner cases) sucks with lots and lots of cylinder
groups, and softdep isn't too wonderful in those situations as well.
the new dirpref code works better in all cases.
the code was ported from freebsd, with the ffs_alloc.c::ffs_reload()
fix made a short while after the initial import into freebsd.
it's fairly similar to what's in freebsd, although i decided to be
consistent between the newfs(8) and tunefs(8) options used to define
the tunefs stuff.
food for thought,
luke.
--
Luke Mewburn <lukem@wasabisystems.com> http://www.wasabisystems.com
Luke Mewburn <lukem@netbsd.org> http://www.netbsd.org
Wasabi Systems - NetBSD hackers for hire
NetBSD - the world's most portable UNIX-like system
--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=dirprefres
machine config
--------------
NetBSD 1.5X (HIPPOLYTE) #7: Mon Sep 3 14:25:30 EST 2001
lukem@hippolyte:/var/scratch/obj.i386/sys/HIPPOLYTE
cpu0: Intel Pentium III (Coppermine) (686-class), 599.74 MHz
cpu0: I-cache 16 KB 32b/line 4-way, D-cache 16 KB 32b/line 2-way
cpu0: L2 cache 256 KB 32b/line 8-way
cpu0: features 387fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features 387fbff<PGE,MCA,CMOV,FGPAT,PSE36,PN,MMX,FXSR,SSE>
cpu0: serial number 0000-0681-0003-B6B3-0359-5689
total memory = 1023 MB
avail memory = 945 MB
using 11424 buffers containing 52504 KB of memory
BIOS32 rev. 0 found at 0xfdb70
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82840 Host (rev. 0x01)
pchb0: random number generator enabled
ppb0 at pci0 dev 1 function 0: Intel 82840 AGP (rev. 0x01)
pci1 at ppb0 bus 4
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: Nvidia Corporation GeForce DDR (rev. 0x10)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
ppb1 at pci0 dev 2 function 0: Intel 82840 PCI (rev. 0x01)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled
ppb2 at pci2 dev 31 function 0: Intel product 0x1360 (rev. 0x02)
pci3 at ppb2 bus 3
pci3: i/o space, memory space enabled
Intel 82806AA PCI64 Hub Advanced Programmable Interrupt Controller (8259 PIC system, interface 0x20, revision 0x01) at pci3 dev 0 function 0 not configured
ppb3 at pci0 dev 30 function 0: Intel 82801AA Hub-to-PCI Bridge (rev. 0x02)
pci4 at ppb3 bus 1
pci4: i/o space, memory space enabled
twe0 at pci4 dev 1 function 0: 3ware Escalade
twe0: interrupting at irq 10
ld0 at twe0 unit 0
ld0: 29313 MB, 7444 cyl, 128 head, 63 sec, 512 bytes/sect x 60034432 sectors
fxp0 at pci4 dev 8 function 0: i82559 Ethernet, rev 8
fxp0: interrupting at irq 11
fxp0: Ethernet address 00:30:48:00:38:fc
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pcib0 at pci0 dev 31 function 0
pcib0: Intel 82801AA LPC Interface Bridge (rev. 0x02)
pciide0 at pci0 dev 31 function 1: Intel 82801AA IDE Controller (ICH) (rev. 0x02)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
atapibus0 at pciide0 channel 0: 2 targets
cd0 at atapibus0 drive 0: <SONY CDU4811, , PY0A> type 5 cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
pciide0: primary channel interrupting at irq 14
cd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
pciide0: secondary channel wired to compatibility mode
wd0 at pciide0 channel 1 drive 0: <IBM-DTLA-307030>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 29314 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 60036480 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
pciide0: secondary channel interrupting at irq 15
wd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
uhci0 at pci0 dev 31 function 2: Intel 82801AA USB Controller (rev. 0x02)
uhci0: interrupting at irq 9
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
Intel 82801AA SMBus Controller (SMBus serial bus, revision 0x02) at pci0 dev 31 function 3 not configured
auich0 at pci0 dev 31 function 5: i82801AA (ICH) AC-97 Audio
auich0: interrupting at irq 10
auich0: Crystal CS4299 codec; headphone, 20 bit DAC, 18 bit ADC, Spatializer 3D
audio0 at auich0: full duplex, mmap, independent
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: kgdb
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
lpt0 at isa0 port 0x378-0x37b irq 7
pcppi0 at isa0 port 0x61
sysbeep0 at pcppi0
npx0 at isa0 port 0xf0-0xff: using exception 16
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
apm0 at mainbus0: Power Management spec V1.2
biomask f765 netmask ff65 ttymask ffe7
IPsec: Initialized Security Association Processing.
ums0 at uhub0 port 1 configuration 1 interface 0
ums0: Microsoft Microsoft IntelliMouse\M-. Optical, rev 1.10/1.08, addr 2, iclass 3/1
ums0: 5 buttons and Z dir.
wsmouse0 at ums0 mux 0
boot device: ld0
root on ld0a dumps on ld0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
==== disk 1 ====
disk 1 config
-------------
endian little-endian
magic 11954 time Tue Nov 5 05:01:04 1935
cylgrp dynamic inodes 4.4BSD fslevel 3 softdep disabled
nbfree 3692676 ndir 1 nifree 1270653 nffree 8
ncg 19854 ncyl 59560 size 30018240 blocks 29541417
bsize 8192 shift 13 mask 0xffffe000
fsize 1024 shift 10 mask 0xfffffc00
frag 8 shift 3 fsbtodb 1
cpg 3 bpg 189 fpg 1512 ipg 64
minfree 5% optim time maxcontig 8 maxbpg 2048
rotdelay 0ms headswitch 0us trackseek 0us rps 120
ntrak 16 nsect 63 npsect 63 spc 1008
symlinklen 60 trackskew 0 interleave 1 contigsumsize 8
maxfilesize 0x0000400801017fff
nindir 2048 inopb 64 nspf 2
sblkno 16 cblkno 24 iblkno 32 dblkno 40
sbsize 2048 cgsize 1024 offset 32 mask 0xfffffff0
csaddr 40 cssize 318464 shift 9 mask 0xfffffe00
cgrotor 0 fmod 0 ronly 0 clean 0x01
old dirpref, maxvnodes 24842, disk 1
------------------------------------
Mode: rw
extract: 591.27 real 4.65 user 58.56 sys
remove: 526.78 real 0.27 user 8.76 sys
Mode: async
extract: 631.19 real 5.16 user 56.12 sys
remove: 228.55 real 0.26 user 6.13 sys
Mode: sync
extract: 608.94 real 4.66 user 73.33 sys
remove: 527.43 real 0.37 user 8.67 sys
Mode: softdep
extract: 624.28 real 4.52 user 61.56 sys
remove: 830.16 real 0.36 user 6.28 sys
(note: umount for softdep took a noticable amount of time, which is why I
changed the benchmark to time the umount as well)
old dirpref, maxvnodes 80000, disk 1
------------------------------------
Mode: rw
extract: 579.42 real 4.86 user 60.52 sys
umount: 2.92 real 0.00 user 2.83 sys
remove: 527.36 real 0.29 user 10.46 sys
umount: 0.86 real 0.00 user 0.05 sys
Mode: async
extract: 605.63 real 4.86 user 53.25 sys
umount: 3.98 real 0.00 user 3.95 sys
remove: 228.34 real 0.36 user 6.08 sys
umount: 1.76 real 0.00 user 0.05 sys
Mode: sync
extract: 585.90 real 4.79 user 72.14 sys
umount: 3.96 real 0.00 user 3.94 sys
remove: 526.41 real 0.26 user 8.82 sys
umount: 0.88 real 0.00 user 0.05 sys
Mode: softdep
extract: 619.76 real 4.83 user 59.69 sys
umount: 4.89 real 0.00 user 2.96 sys
remove: 696.70 real 0.26 user 5.14 sys
umount: 477.65 real 0.00 user 1.91 sys
new dirpref, maxvnodes 24842, disk 1
------------------------------------
Mode: rw
extract: 245.98 real 4.45 user 34.55 sys
umount: 4.10 real 0.00 user 1.09 sys
remove: 349.78 real 0.27 user 8.24 sys
umount: 0.15 real 0.00 user 0.04 sys
Mode: async
extract: 226.59 real 4.49 user 29.81 sys
umount: 6.68 real 0.00 user 0.87 sys
remove: 81.41 real 0.31 user 5.44 sys
umount: 1.53 real 0.00 user 0.04 sys
Mode: sync
extract: 346.64 real 4.42 user 48.84 sys
umount: 1.28 real 0.00 user 1.08 sys
remove: 393.18 real 0.24 user 8.24 sys
umount: 0.42 real 0.00 user 0.03 sys
Mode: softdep
extract: 207.12 real 4.74 user 36.53 sys
umount: 1.32 real 0.00 user 1.12 sys
remove: 311.44 real 0.22 user 5.79 sys
umount: 78.91 real 0.00 user 0.09 sys
new dirpref, maxvnodes 80000, disk 1
------------------------------------
Mode: rw
extract: 238.47 real 4.31 user 32.69 sys
umount: 3.99 real 0.00 user 3.95 sys
remove: 349.27 real 0.20 user 8.22 sys
umount: 0.36 real 0.00 user 0.05 sys
Mode: async
extract: 176.61 real 4.34 user 28.72 sys
umount: 8.95 real 0.00 user 3.96 sys
remove: 74.30 real 0.40 user 5.34 sys
umount: 1.15 real 0.00 user 0.05 sys
Mode: sync
extract: 339.81 real 4.52 user 47.43 sys
umount: 5.98 real 0.00 user 3.94 sys
remove: 401.05 real 0.24 user 8.19 sys
umount: 0.40 real 0.00 user 0.05 sys
Mode: softdep
extract: 182.36 real 4.60 user 35.06 sys
umount: 22.13 real 0.00 user 4.26 sys
remove: 261.88 real 0.26 user 4.88 sys
umount: 100.87 real 0.00 user 0.13 sys
==== disk 2 ====
disk 2 config
-------------
endian little-endian
magic 11954 time Mon Sep 3 16:15:26 2001
id [ 0 0 ]
cylgrp dynamic inodes 4.4BSD fslevel 3 softdep disabled
nbfree 3720621 ndir 1 nifree 1906685 nffree 8
ncg 931 ncyl 59560 size 30018240 blocks 29764977
bsize 8192 shift 13 mask 0xffffe000
fsize 1024 shift 10 mask 0xfffffc00
frag 8 shift 3 fsbtodb 1
cpg 64 bpg 4032 fpg 32256 ipg 2048
minfree 5% optim time maxcontig 8 maxbpg 2048
rotdelay 0ms rps 120
ntrak 16 nsect 63 npsect 63 spc 1008
symlinklen 60 trackskew 0 interleave 1 contigsumsize 8
maxfilesize 0x0000400801017fff
nindir 2048 inopb 64 nspf 2
sblkno 16 cblkno 24 iblkno 32 dblkno 288
sbsize 2048 cgsize 6144 offset 32 mask 0xfffffff0
csaddr 288 cssize 15360 shift 9 mask 0xfffffe00
cgrotor 0 fmod 0 ronly 0 clean 0x01
old dirpref, maxvnodes 24842, disk 2
------------------------------------
Mode: rw
extract: 470.31 real 4.57 user 36.40 sys
umount: 5.91 real 0.00 user 0.92 sys
remove: 449.10 real 0.28 user 8.43 sys
umount: 2.08 real 0.00 user 0.03 sys
Mode: async
extract: 185.38 real 4.33 user 32.03 sys
umount: 8.42 real 0.00 user 0.88 sys
remove: 174.93 real 0.27 user 5.71 sys
umount: 1.88 real 0.00 user 0.03 sys
Mode: sync
extract: 469.81 real 4.67 user 50.17 sys
umount: 5.69 real 0.00 user 0.90 sys
remove: 451.40 real 0.23 user 8.48 sys
umount: 0.50 real 0.00 user 0.01 sys
Mode: softdep
extract: 465.18 real 4.36 user 39.21 sys
umount: 6.35 real 0.00 user 1.08 sys
remove: 406.45 real 0.43 user 6.69 sys
umount: 53.90 real 0.00 user 0.04 sys
old dirpref, maxvnodes 80000, disk 2
------------------------------------
Mode: rw
extract: 430.93 real 4.64 user 37.20 sys
umount: 8.27 real 0.00 user 2.81 sys
remove: 453.37 real 0.38 user 10.06 sys
umount: 1.31 real 0.00 user 0.05 sys
Mode: async
extract: 136.87 real 4.25 user 30.46 sys
umount: 11.79 real 0.00 user 3.47 sys
remove: 167.66 real 0.34 user 5.65 sys
umount: 5.95 real 0.00 user 0.05 sys
Mode: sync
extract: 445.33 real 4.61 user 48.87 sys
umount: 7.83 real 0.00 user 3.94 sys
remove: 451.72 real 0.31 user 8.39 sys
umount: 0.72 real 0.00 user 0.05 sys
Mode: softdep
extract: 374.42 real 4.29 user 37.03 sys
umount: 15.33 real 0.00 user 4.20 sys
remove: 360.48 real 0.36 user 5.34 sys
umount: 68.43 real 0.00 user 0.06 sys
new dirpref, maxvnodes 24842, disk 2
------------------------------------
Mode: rw
extract: 163.90 real 4.54 user 34.19 sys
umount: 1.21 real 0.00 user 0.90 sys
remove: 218.22 real 0.27 user 8.00 sys
umount: 0.37 real 0.00 user 0.03 sys
Mode: async
extract: 55.65 real 4.50 user 35.58 sys
umount: 2.97 real 0.00 user 0.91 sys
remove: 15.14 real 0.30 user 5.25 sys
umount: 0.90 real 0.00 user 0.03 sys
Mode: sync
extract: 224.05 real 4.67 user 48.45 sys
umount: 1.13 real 0.00 user 0.91 sys
remove: 222.71 real 0.35 user 7.91 sys
umount: 0.77 real 0.00 user 0.02 sys
Mode: softdep
extract: 88.62 real 4.61 user 36.67 sys
umount: 3.64 real 0.00 user 0.96 sys
remove: 147.72 real 0.23 user 5.75 sys
umount: 23.81 real 0.00 user 0.02 sys
new dirpref, maxvnodes 80000, disk 2
------------------------------------
Mode: rw
extract: 159.08 real 4.61 user 32.33 sys
umount: 4.04 real 0.00 user 3.98 sys
remove: 217.95 real 0.18 user 8.06 sys
umount: 0.63 real 0.00 user 0.05 sys
Mode: async
extract: 42.14 real 4.50 user 28.35 sys
umount: 4.03 real 0.00 user 3.97 sys
remove: 15.46 real 0.28 user 5.28 sys
umount: 0.93 real 0.00 user 0.05 sys
Mode: sync
extract: 220.01 real 4.70 user 46.93 sys
umount: 4.04 real 0.00 user 4.00 sys
remove: 218.42 real 0.34 user 7.91 sys
umount: 0.68 real 0.00 user 0.05 sys
Mode: softdep
extract: 80.30 real 4.39 user 35.49 sys
umount: 4.15 real 0.00 user 4.10 sys
remove: 47.47 real 0.37 user 4.58 sys
umount: 32.36 real 0.00 user 0.07 sys
--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=testdisk
#!/bin/sh
DEV=/dev/wd0a
MOUNT=/mnt
TARFILE=/var/tmp/pkgsrc.tar.gz
EXTRACTED=pkgsrc
OPERATIONS=${1:-rw async sync softdep}
#trap "umount $MOUNT" EXIT
benchit()
{
_mode=$1
if [ -z "$_mode" ]; then
echo "usage: benchit() mode"
exit 1
fi
echo "Mode: $_mode"
mount -o $_mode $DEV $MOUNT
echo -n "extract: "
time tar -C $MOUNT -zxf $TARFILE
sync
echo -n " umount: "
time umount $MOUNT
mount -o $_mode $DEV $MOUNT
echo -n " remove: "
time rm -rf $MOUNT/$EXTRACTED
sync
echo -n " umount: "
time umount $MOUNT
echo ""
}
echo "Testing $DEV on $MOUNT, extracting $TARFILE to $MOUNT/$EXTRACTED"
echo ""
for op in $OPERATIONS; do
benchit $op
done
--opJtzjQTFsWo+cga--