Subject: very slow performance on filesystem meta-data in 1.6 -current
To: None <port-macppc@netbsd.org>
From: =?ISO-8859-1?Q?Erik_=C4ngg=E5rd?= <erik.anggard@packetfront.com>
List: tech-kern
Date: 07/15/2002 22:58:29
This message is in MIME format.

---MOQ10267667098382ff7c2462cac0a2704d5bf291f291
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Hi,

(I'm not sure this only macppc-related so I also cc:ed tech-kern).

We have an old Mac (about a year old, 500MHz I think) running a -current
kernel from January (1.5ZA) that works very well. A few weeks ago we
bought two new Macs (QuickSilver 2002, 800MHz) to replace the old one.
After having installed a 1.6 snapshot (I think it was 200207060000) on
the new Macs we started to try them out by compiling some stuff. Much to
our disappointment we discovered that the two new Macs were much slower
than the old one. I then ran some benchmark-tests from
/usr/pkgsrc/benchmarks and the new Macs came out on top in all of them
except for tests involving file system meta-data (i.e. creating and
deleting files). Just writing data to a file was somewhat faster on the
new Macs so it doesn't seem to be a problem with disk i/o. I then wrote
a little program that just creates 1000 files and timed it on different
types of filesystems and came up with the following table:

                             Old Mac        New Mac
local disk                   0.7s           19s
local disk w soft updates    n/a            0.3s
nfs mounted directory        1s             29s

As you can see turning on soft updates solved the problem for local disk
access but since we use nfs quite a lot it doesn't help us much.

I've update the sources on the new Macs and recompiled the kernel every
other day (last time today) but so far it hasn't solved this problem.
I've skimmed the mailing-lists for the last two months and I've seen
quite a few posts about preformance-issues but nothing directly related
to filesystem meta-data.

So my question is: has anyone else experienced problems like this? Is
there a known solution?

I've attached a few files that might be of interest:
- dmesg.oldmac: dmesg from the old Mac
- dmesg.newmac: dmesg from one of the new Macs
- metatst.c: the simple program I ran to time creation of files.

I also put a file on a web-server: http://195.163.5.2/gprof.metatst  
It is output from gprof after profiling of kernel during a run of "metatst 1000"
in an nfs-directory mounted on one of the new Macs.

I'd also be very grateful if there is anyone on the list with a
QuickSilver 2002 800MHz Mac that would like to run and time the attached
metatst program to see if they get the same figures.

Thanks,
Erik

---MOQ10267667098382ff7c2462cac0a2704d5bf291f291
Content-Type: application/octet-stream; name="dmesg.oldmac"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="dmesg.oldmac"

TmV0QlNEIDEuNVpBIChQRUFSKSAjMDogTW9uIEp1bCAxNSAxMTozODowNSBDRVNUIDIwMDINC
iAgICBlcmlhbmdAcGVhcjovdXNyL3NyYy9zeXMvYXJjaC9tYWNwcGMvY29tcGlsZS9QRUFSLl
BST0YNCnRvdGFsIG1lbW9yeSA9IDI1NiBNQg0KYXZhaWwgbWVtb3J5ID0gMjI4IE1CDQp1c2l
uZyAyMDQ4IGJ1ZmZlcnMgY29udGFpbmluZyAxMzIwOCBLQiBvZiBtZW1vcnkNCm1haW5idXMw
IChyb290KQ0KY3B1MCBhdCBtYWluYnVzMDogNzQxMCAoUmV2aXNpb24gMTEwMyksIElEIDAgK
HByaW1hcnkpDQpjcHUwOiBISUQwIDgwOTRjMGE0PEVNQ1AsRE9aRSxEUE0sRUlFQyxJQ0UsRE
NFLFNHRSxCVElDLEJIVD4NCmNwdTA6IDFNQiBiYWNrc2lkZSBjYWNoZQ0KdW5pbm9ydGgwIGF
0IG1haW5idXMwDQpwY2kwIGF0IHVuaW5vcnRoMCBidXMgMA0KcGNpMDogaS9vIHNwYWNlLCBt
ZW1vcnkgc3BhY2UgZW5hYmxlZA0KQXBwbGUgQ29tcHV0ZXIgVW5pTm9ydGggQUdQIEludGVyZ
mFjZSAoaG9zdCBicmlkZ2UpIGF0IHBjaTAgZGV2IDExIGZ1bmN0aW9uIDAgbm90IGNvbmZpZ3
VyZWQNCm9mYjAgYXQgcGNpMCBkZXYgMTYgZnVuY3Rpb24gMDogTnZpZGlhIENvcnBvcmF0aW9
uIEdlRm9yY2UyIE1YIFtOVjExXQ0Kb2ZiMDogNjQwIHggNDgwLCA4YnBwDQp3c2Rpc3BsYXkw
IGF0IG9mYjAga2JkbXV4IDE6IGNvbnNvbGUgKHN0ZCwgdnQxMDAgZW11bGF0aW9uKQ0Kd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WRkciA0LCBpY2xhc3MgMy8xDQp1bXMwIGF0IHVoaWRldjI6IDEgYnV0dG9uDQp3c21vdXNlM
SBhdCB1bXMwIG11eCAwDQpib290IGRldmljZTogd2QwDQpyb290IG9uIHdkMGEgZHVtcHMgb2
4gd2QwYg0Kcm9vdCBmaWxlIHN5c3RlbSB0eXBlOiBmZnMNCg==


---MOQ10267667098382ff7c2462cac0a2704d5bf291f291
Content-Type: text/plain; name="dmesg.newmac"; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="dmesg.newmac"

NetBSD 1.6D (BANANA-$Revision: 1.138 $) #3: Mon Jul 15 17:57:37 CEST 2002
    eriang@banana:/usr/src/sys/arch/macppc/compile/BANANA.PROF
total memory = 512 MB
avail memory = 461 MB
using 3072 buffers containing 26316 KB of memory
mainbus0 (root)
cpu0 at mainbus0: 7450 (Revision 2.1), ID 0 (primary)
cpu0: HID0 8450c0bc<EMCP,TBEN,NAP,DPM,ICE,DCE,SGE,BTIC,LRSTK,FOLD,BHT>
cpu0: 800.00 MHz
cpu0: 256KB L2 cache
uninorth0 at mainbus0
pci0 at uninorth0 bus 0
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 11 function 0
pchb0: Apple Computer UniNorth AGP Interface (rev. 0x00)
ofb0 at pci0 dev 16 function 0: ATI Technologies Radeon 7500
ofb0: 640 x 480, 8bpp
wsdisplay0 at ofb0 kbdmux 1: console (std, vt100 emulation)
wsmux1: connecting to wsdisplay0
uninorth1 at mainbus0
pci1 at uninorth1 bus 0
pci1: i/o space, memory space enabled
pchb1 at pci1 dev 11 function 0
pchb1: Apple Computer UniNorth Host-PCI Bridge (rev. 0x00)
obio0 at pci1 dev 23 function 0: addr 0x80000000
zsc0 at obio0 offset 0x13000: irq 22,23
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
i2s at obio0 offset 0x10000 not configured
adb0 at obio0 offset 0x16000 irq 47: pm_adb_op: timeout. command = 0x0
0 targets
aed0 at adb0 addr 0: ADB Event device
apm0 at adb0: battery flags 0x1, 0% charged
wdc0 at obio0 offset 0x1f000 irq 19: DMA transfer
wd0 at wdc0 channel 0 drive 0: <IBM-IC35L040AVER07-0>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 39266 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 80418240 sectors
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
ata4 conf[0] = 0xc519465, cyc = 2 (30 ns), act = 6 (90 ns), inact = 3
wd0(wdc0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66) (using DMA data transfers)
wdc1 at obio0 offset 0x20000 irq 20: DMA transfer
atapibus0 at wdc1 channel 0: 2 targets
cd0 at atapibus0 drive 0: <SONY    CD-RW  CRX170E, , 2.2d> type 5 cdrom removable
cd0: drive supports PIO mode 4, DMA mode 2
conf[0] = 0x11823, cyc = 4 (120 ns), act = 3 (75 ns), inact = 1
cd0(wdc1:0:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
wdc2 at obio0 offset 0x21000 irq 21: DMA transfer
ohci0 at pci1 dev 24 function 0: Apple Computer KeyLargo USB Controller (rev. 0x00)
ohci0: interrupting at irq 27
ohci0: OHCI version 1.0
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: Apple Computer OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
ohci1 at pci1 dev 25 function 0: Apple Computer KeyLargo USB Controller (rev. 0x00)
ohci1: interrupting at irq 28
ohci1: OHCI version 1.0
usb1 at ohci1: USB revision 1.0
uhub1 at usb1
uhub1: Apple Computer OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uninorth2 at mainbus0
pci2 at uninorth2 bus 0
pci2: i/o space, memory space enabled
pchb2 at pci2 dev 11 function 0
pchb2: Apple Computer UniNorth Host-PCI Bridge (rev. 0x00)
fwohci0 at pci2 dev 14 function 0: Lucent Technologies product 0x5811 (rev. 0x00)
fwohci0: interrupting at irq 40
fwohci0: OHCI 1.0, 00:03:93:ff:fe:7b:51:cc, 400Mb/s, 2048 max_rec, 8 iso_ctx
gm0 at pci2 dev 15 function 0: Ethernet address 00:03:93:7b:51:cc
gm0: interrupting at irq 41
brgphy0 at gm0 phy 0: BCM5421 1000BASE-T media interface, rev. 1
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
Profiling kernel, textsize=3022680 [800000..ae1f58]
fw0 at fwohci0: 00:03:93:ff:fe:7b:51:cc:0a:02:20:00:00:00:00:00
uhub2 at uhub1 port 1
uhub2: Mitsumi Electric Hub in Apple Extended USB Keyboard, class 9/0, rev 1.10/1.22, addr 2
uhub2: 3 ports with 2 removable, bus powered
uhidev0 at uhub2 port 1 configuration 1 interface 0
uhidev0: Mitsumi Electric Apple Extended USB Keyboard, rev 1.10/1.22, addr 3, iclass 3/1
ukbd0 at uhidev0: 8 modifier keys, 6 key codes
wskbd1 at ukbd0: console keyboard, using wsdisplay0
uhidev1 at uhub2 port 1 configuration 1 interface 1
uhidev1: Mitsumi Electric Apple Extended USB Keyboard, rev 1.10/1.22, addr 3, iclass 3/0
uhidev1: 3 report ids
uhid0 at uhidev1 reportid 2: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 3: input=3, output=0, feature=0
uhidev2 at uhub2 port 2 configuration 1 interface 0
uhidev2: Fujitsu Component Apple Optical USB Mouse, rev 1.10/1.00, addr 4, iclass 3/1
ums0 at uhidev2: 1 button
wsmouse1 at ums0 mux 0
boot device: wd0
root on wd0a dumps on wd0b

---MOQ10267667098382ff7c2462cac0a2704d5bf291f291
Content-Type: text/plain; name="metatst.c"; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="metatst.c"

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>

int
main(int argc, char *argv[])
{
	int i, n, fd;
	char fname[100];

	if (argc < 2) {
		fprintf(stderr, "usage: metatst num\n");
		exit (1);
	}

	n = atoi(argv[1]);


	printf("Creating %d files...\n", n);

	for (i = 0; i < n; i++) {
		snprintf(fname, 99, "metatst.%d", i);
		fd = open(fname, O_WRONLY|O_CREAT, 0664);
		close(fd);
	}

	return (0);
}

---MOQ10267667098382ff7c2462cac0a2704d5bf291f291--