Reboots under 6.0 while exercising md device

2005-12-21 Thread James Long
For some reason, this script:

#!/bin/sh

DEV=$(md_config -a -t malloc -s 500m)
newfs -i 512 -U /dev/$DEV

mount /dev/$DEV /mnt
cp -Rp /usr/src /mnt/


will kill my machine.  I get zillions (well, hundreds at
least, without a serial console I can't count them)
of:


Dec 21 19:16:27 test kernel: g_vfs_done():md0[WRITE(offset=352649216, 
length=16384)]error = 28
Dec 21 19:16:27 test kernel: g_vfs_done():md0[WRITE(offset=352665600, 
length=12288)]error = 28

with varying offsets and lengths, but seemingly always error 28

The system does not panic orderly, but rather spontaneously reboots after
spewing a lot of the above error messages (5-20 secs worth).

This is on a Compaq Proliant ML370 with 1 GB RAM, dmesg below.


What do I need to fix to be able to use a RAM-backed filesystem?


Jim

FWIW, this script does not seem to freak out my machine,  This led
me to consider inode starvation, but '-i 512' results in over 6 
inodes for what I estimate to be  4 files in /usr/src.

#!/bin/sh

DEV=$(mdconfig -a -t malloc -s 500m)
newfs -i 512 -U /dev/$DEV

mount /dev/$DEV /mnt

dd if=/dev/zero of=/mnt/1M bs=1024 count=1024

for j in $(jot 450); do {
  cp -p /mnt/1M /mnt/1M.$(printf %03d $j)
} done


After that, df -h /mnt shows:

/dev/md0 484M458M-13M   103%/mnt


Here's the dmesg:


Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 6.0-RELEASE #0: Wed Dec 21 15:40:38 PST 2005
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/SMP
Timecounter i8254 frequency 1193182 Hz quality 0
CPU: Intel Pentium III (996.85-MHz 686-class CPU)
  Origin = GenuineIntel  Id = 0x686  Stepping = 6
  
Features=0x383fbffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE
real memory  = 1073725440 (1023 MB)
avail memory = 1041682432 (993 MB)
MPTable: COMPAQ   PROLIANT
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  1
 cpu1 (AP): APIC ID:  0
ioapic0: Changing APIC ID to 8
ioapic0: Assuming intbase of 0
ioapic0 Version 1.1 irqs 0-34 on motherboard
npx0: [FAST]
npx0: math processor on motherboard
npx0: INT 16 interface
cpu0 on motherboard
cpu1 on motherboard
pcib0: ServerWorks NB6635 3.0LE host to PCI bridge pcibus 0 on motherboard
pci0: PCI bus on pcib0
sym0: 1510d port 0x2000-0x20ff mem 
0xc6effc00-0xc6ef,0xc6efe000-0xc6efefff irq 11 at device 1.0 on pci0
sym0: No NVRAM, ID 7, Fast-40, LVD, parity checking
sym0: [GIANT-LOCKED]
sym1: 1510d port 0x2400-0x24ff mem 
0xc6efdc00-0xc6efdfff,0xc6efc000-0xc6efcfff irq 15 at device 1.1 on pci0
sym1: No NVRAM, ID 7, Fast-40, LVD, parity checking
sym1: [GIANT-LOCKED]
fxp0: Intel 82559 Pro/100 Ethernet port 0x2800-0x283f mem 
0xc6efb000-0xc6efbfff,0xc6d0-0xc6df irq 5 at device 2.0 on pci0
miibus0: MII bus on fxp0
inphy0: i82555 10/100 media interface on miibus0
inphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: Ethernet address: 00:02:a5:64:d5:4e
pci0: display, VGA at device 3.0 (no driver attached)
pci0: base peripheral at device 4.0 (no driver attached)
isab0: PCI-ISA bridge at device 15.0 on pci0
isa0: ISA bus on isab0
atapci0: ServerWorks ROSB4 UDMA33 controller port 
0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x3000-0x300f at device 15.1 on pci0
ata0: ATA channel 0 on atapci0
ata1: ATA channel 1 on atapci0
pcib3: ServerWorks NB6635 3.0LE host to PCI bridge pcibus 3 on motherboard
pci3: PCI bus on pcib3
ida0: Compaq Smart Array 431 controller port 0x4000-0x40ff mem 
0xc6fff000-0xc6ff irq 10 at device 6.0 on pci3
ida0: [GIANT-LOCKED]
ida0: drives=1 firm_rev=1.18
idad0: Compaq Logical Drive on ida0
idad0: 17363MB (35561280 sectors), blocksize=512
eisa0: EISA bus on motherboard
mainboard0: CPQ0690 (System Board) on eisa0 slot 0
eisa0: unknown card @@D9004 (0x00049004) at slot 2
pmtimer0 on isa0
orm0: ISA Option ROMs at iomem 
0xc-0xc7fff,0xc8000-0xcbfff,0xe8000-0xedfff,0xee000-0xe on isa0
atkbdc0: Keyboard controller (i8042) at port 0x60,0x64 on isa0
atkbd0: AT Keyboard irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: PS/2 Mouse irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse, device ID 3
fdc0: Enhanced floppy controller at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: [FAST]
fd0: 1440-KB 3.5 drive on fdc0 drive 0
ppc0: Parallel port at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppbus0: Parallel port bus on ppc0
plip0: PLIP network interface on ppbus0
lpt0: Printer on ppbus0
lpt0: Interrupt-driven port
ppi0: Parallel I/O on ppbus0
sc0: System console at flags 0x100 on isa0
sc0: VGA 16 virtual consoles, flags=0x300
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
vga0: Generic ISA VGA at port 0x3c0-0x3df iomem 0xa-0xb on isa0
Timecounters tick every 1.000 msec
acd0: CDROM COMPAQ 

Re: Reboots under 6.0 while exercising md device

2005-12-21 Thread Brooks Davis
On Wed, Dec 21, 2005 at 07:50:49PM -0800, James Long wrote:
 For some reason, this script:
 
 #!/bin/sh
 
 DEV=$(md_config -a -t malloc -s 500m)
 newfs -i 512 -U /dev/$DEV
 
 mount /dev/$DEV /mnt
 cp -Rp /usr/src /mnt/
 
 
 will kill my machine.  I get zillions (well, hundreds at
 least, without a serial console I can't count them)
 of:
 
 
 Dec 21 19:16:27 test kernel: g_vfs_done():md0[WRITE(offset=352649216, 
 length=16384)]error = 28
 Dec 21 19:16:27 test kernel: g_vfs_done():md0[WRITE(offset=352665600, 
 length=12288)]error = 28
 
 with varying offsets and lengths, but seemingly always error 28
 
 The system does not panic orderly, but rather spontaneously reboots after
 spewing a lot of the above error messages (5-20 secs worth).
 
 This is on a Compaq Proliant ML370 with 1 GB RAM, dmesg below.
 
 
 What do I need to fix to be able to use a RAM-backed filesystem?

From mdconfig(8):

 -t type
 Select the type of the memory disk.

 malloc   Storage for this type of memory disk is allocated with
  malloc(9).  This limits the size to the malloc bucket
  limit in the kernel.  If the -o reserve option is not
  set, creating and filling a large malloc-backed memory
  disk is a very easy way to panic a system.

As a rule, swap or vnode backed md devices are a better idea than malloc
ones.

-- Brooks

-- 
Any statement of the form X is the one, true Y is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4


pgpTeI97ILMoZ.pgp
Description: PGP signature