GENERIC HEAD from vm6 124fc07, vmcore.375 KDB: debugger backends: ddb KDB: current backend: ddb 524288K of memory above 4GB ignored Copyright (c) 1992-2009 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 is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #0 r199281+124fc07: Sun Nov 15 19:09:16 CET 2009 pho@x4.osted.lan:/var/tmp/deviant2/sys/i386/compile/PHO i386 WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: AMD Phenom(tm) 9150e Quad-Core Processor (1800.59-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0x100f23 Stepping = 3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x7ff TSC: P-state invariant real memory = 4294967296 (4096 MB) avail memory = 3536183296 (3372 MB) : Trying to mount root from ufs:/dev/ad4s1a Enter full pathname of shell or RETURN for /bin/sh: # swapon -a swapon: adding /dev/ad4s1b as swap device swapon: adding /dev/ad4s2b as swap device # dumpon /dev/ad4s1b # exit panic: ffs_read: UIO_USERSPACE cpuid = 0 KDB: enter: panic [thread pid 25 tid 100079 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> set $lines 0 db> bt Tracing pid 25 tid 100079 td 0xc7804af0 kdb_enter(c0c941c3,c0c941c3,c0cbbfea,f643aa60,0,...) at kdb_enter+0x3a panic(c0cbbfea,c717dec8,c0f2e370,c7804b94,c0ca2998,...) at panic+0x136 ffs_read(f643ab30,c0cd13a9,0,2d,8,...) at ffs_read+0x47 VOP_READ_APV(c0d9f0c0,f643ab30,8,2,8,...) at VOP_READ_APV+0xc5 vn_read_chunk(c79466f4,f643ac00,c7175100,c7175100,8,...) at vn_read_chunk+0xf1 ufs_readdir(f643ac20,c0cd12e0,0,0,c79466f4,...) at ufs_readdir+0xc2 VOP_READDIR_APV(c0d9f0c0,f643ac20,c0ca298f,1000,1000,...) at VOP_READDIR_APV+0xc5 kern_getdirentries(c7804af0,3,28309000,1000,f643ac74,...) at kern_getdirentries+0x214 getdirentries(c7804af0,f643acf8,10,c7804af0,c0d7e910,...) at getdirentries+0x31 syscall(f643ad38) at syscall+0x2b4 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (196, FreeBSD ELF32, getdirentries), eip = 0x281cf5ef, esp = 0xbfbfe8dc, ebp = 0xbfbfe908 --- db> show allpcpu Current CPU: 0 cpuid = 0 dynamic pcpu = 0x66b000 curthread = 0xc7804af0: pid 25 "sh" curpcb = 0xf643ad90 fpcurthread = 0xc7804af0: pid 25 "sh" idlethread = 0xc7179460: pid 11 "idle: cpu0" APIC ID = 0 currentldt = 0x50 spin locks held: cpuid = 1 dynamic pcpu = 0x602a000 curthread = 0xc7179690: pid 11 "idle: cpu1" curpcb = 0xc6e0ad90 fpcurthread = none idlethread = 0xc7179690: pid 11 "idle: cpu1" APIC ID = 1 currentldt = 0x50 spin locks held: cpuid = 2 dynamic pcpu = 0x602d000 curthread = 0xc7179000: pid 12 "swi4: clock" curpcb = 0xc6e14d90 fpcurthread = none idlethread = 0xc71798c0: pid 11 "idle: cpu2" APIC ID = 2 currentldt = 0x50 spin locks held: cpuid = 3 dynamic pcpu = 0x6030000 curthread = 0xc7179af0: pid 11 "idle: cpu3" curpcb = 0xc6e04d90 fpcurthread = none idlethread = 0xc7179af0: pid 11 "idle: cpu3" APIC ID = 3 currentldt = 0x50 spin locks held: db> show alllocks Process 25 (sh) thread 0xc7804af0 (100079) shared lockmgr ufs (ufs) r = 0 (0xc794674c) locked @ kern/vfs_syscalls.c:4096 db> show lockedvnods Locked vnodes 0xc79466f4: tag ufs, type VDIR usecount 1, writecount 0, refcount 1 mountedhere 0 flags () v_object 0xc782a110 ref 0 pages 0 lock type ufs: SHARED (count 1) #0 0xc0871c82 at __lockmgr_args+0x582 #1 0xc0aca521 at ffs_lock+0xa1 #2 0xc0bdb645 at VOP_LOCK1_APV+0xb5 #3 0xc0928c18 at _vn_lock+0x78 #4 0xc0927610 at kern_getdirentries+0x190 #5 0xc0927871 at getdirentries+0x31 #6 0xc0bc2814 at syscall+0x2b4 #7 0xc0ba4c90 at Xint0x80_syscall+0x20 ino 164883, on dev ad4s1a db> show mount 0xc77aab40 /dev/ad4s1a on / (ufs) 0xc77ab000 devfs on /dev (devfs) More info: show mount db> ps pid ppid pgrp uid state wmesg wchan cmd 25 1 25 0 Rs+ CPU 0 sh 21 0 0 0 SL flowclea 0xc0f5b548 [flowcleaner] 20 0 0 0 SL sdflush 0xc0f66c80 [softdepflush] 19 0 0 0 SL vlruwt 0xc7783550 [vnlru] 18 0 0 0 SL syncer 0xc0f5b354 [syncer] 17 0 0 0 SL psleep 0xc0f5b088 [bufdaemon] 16 0 0 0 SL pgzero 0xc0f67a94 [pagezero] 15 0 0 0 SL psleep 0xc0f676c4 [vmdaemon] 9 0 0 0 SL psleep 0xc0f6768c [pagedaemon] 8 0 0 0 SL waiting_ 0xc0f5ce7c [sctp_iterator] 7 0 0 0 SL - 0xc73c0c3c [fdc0] 6 0 0 0 SL - 0xc73f5000 [fw0_probe] 14 0 0 0 SL (threaded) [usb] 100058 D - 0xc73d4d0c [usbus5] 100057 D - 0xc73d4cdc [usbus5] 100056 D - 0xc73d4cac [usbus5] 100055 D - 0xc73d4c7c [usbus5] 100053 D - 0xc73c6b5c [usbus4] 100052 D - 0xc73c6b2c [usbus4] 100051 D - 0xc73c6afc [usbus4] 100050 D - 0xc73c6acc [usbus4] 100049 D - 0xc73c2b5c [usbus3] 100048 D - 0xc73c2b2c [usbus3] 100047 D - 0xc73c2afc [usbus3] 100046 D - 0xc73c2acc [usbus3] 100045 D - 0xc73bbb5c [usbus2] 100044 D - 0xc73bbb2c [usbus2] 100043 D - 0xc73bbafc [usbus2] 100042 D - 0xc73bbacc [usbus2] 100040 D - 0xc73b6b5c [usbus1] 100039 D - 0xc73b6b2c [usbus1] 100038 D - 0xc73b6afc [usbus1] 100037 D - 0xc73b6acc [usbus1] 100035 D - 0xc73a7b5c [usbus0] 100034 D - 0xc73a7b2c [usbus0] 100033 D - 0xc73a7afc [usbus0] 100032 D - 0xc73a7acc [usbus0] 5 0 0 0 SL ccb_scan 0xc0dbacd4 [xpt_thrd] 13 0 0 0 SL - 0xc0dee8e4 [yarrow] 4 0 0 0 SL - 0xc0dec6c4 [g_down] 3 0 0 0 SL - 0xc0dec6c0 [g_up] 2 0 0 0 SL - 0xc0dec6b8 [g_event] 12 0 0 0 RL (threaded) [intr] 100066 I [irq12: psm0] 100065 I [irq1: atkbd0] 100063 I [swi0: uart] 100060 I [irq20: fwohci0] 100059 I [irq14: ata0] 100054 I [irq19: ehci0] 100041 I [irq18: ohci2 ohci4] 100036 I [irq17: ohci1 ohci3] 100031 I [irq16: hdac1 ohci0] 100030 I [irq22: atapci0] 100029 I [irq256: hdac0] 100028 I [irq9: acpi0] 100027 I [swi5: +] 100022 I [swi2: cambio] 100020 I [swi6: task queue] 100019 I [swi6: Giant taskq] 100012 I [swi1: netisr 0] 100011 I [swi4: clock] 100010 I [swi4: clock] 100009 I [swi4: clock] 100008 Run CPU 2 [swi4: clock] 100007 I [swi3: vm] 11 0 0 0 RL (threaded) [idle] 100006 CanRun [idle: cpu0] 100005 Run CPU 1 [idle: cpu1] 100004 CanRun [idle: cpu2] 100003 Run CPU 3 [idle: cpu3] 1 0 1 0 SLs wait 0xc7177d48 [init] 10 0 0 0 SL audit_wo 0xc0f665a0 [audit] 0 0 0 0 SLs (threaded) [kernel] 100061 D - 0xc73a0840 [fw0_taskq] 100026 D - 0xc734d080 [kqueue taskq] 100025 D - 0xc734d0c0 [acpi_task_2] 100024 D - 0xc734d0c0 [acpi_task_1] 100023 D - 0xc734d0c0 [acpi_task_0] 100018 D - 0xc734d500 [thread taskq] 100016 D - 0xc715ed40 [firmware taskq] 100000 D sched 0xc0dec780 [swapper] db> allt~  Tracing command sh pid 25 tid 100079 td 0xc7804af0 kdb_enter(c0c941c3,c0c941c3,c0cbbfea,f643aa60,0,...) at kdb_enter+0x3a panic(c0cbbfea,c717dec8,c0f2e370,c7804b94,c0ca2998,...) at panic+0x136 ffs_read(f643ab30,c0cd13a9,0,2d,8,...) at ffs_read+0x47 VOP_READ_APV(c0d9f0c0,f643ab30,8,2,8,...) at VOP_READ_APV+0xc5 vn_read_chunk(c79466f4,f643ac00,c7175100,c7175100,8,...) at vn_read_chunk+0xf1 ufs_readdir(f643ac20,c0cd12e0,0,0,c79466f4,...) at ufs_readdir+0xc2 VOP_READDIR_APV(c0d9f0c0,f643ac20,c0ca298f,1000,1000,...) at VOP_READDIR_APV+0xc5 kern_getdirentries(c7804af0,3,28309000,1000,f643ac74,...) at kern_getdirentries+0x214 getdirentries(c7804af0,f643acf8,10,c7804af0,c0d7e910,...) at getdirentries+0x31 syscall(f643ad38) at syscall+0x2b4 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (196, FreeBSD ELF32, getdirentries), eip = 0x281cf5ef, esp = 0xbfbfe8dc, ebp = 0xbfbfe908 --- Tracing command flowcleaner pid 21 tid 100075 td 0xc74e8460 sched_switch(c74e8460,0,104,191,d0327dfb,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c74e8460,0,c0c9862c,26e,c74e8460,...) at sleepq_switch+0x15f sleepq_timedwait(c0f5b548,0,f423ecc4,1,0,...) at sleepq_timedwait+0x6b _cv_timedwait(c0f5b548,c0f5b550,2710,3f0,0,...) at _cv_timedwait+0x250 flowtable_cleaner(0,f423ed38,c0c8f643,343,c7783000,...) at flowtable_cleaner+0x1bf fork_exit(c0932630,0,f423ed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf423ed70, ebp = 0 --- Tracing command softdepflush pid 20 tid 100074 td 0xc74e8690 sched_switch(c74e8690,0,104,191,cf77c104,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,44,...) at mi_switch+0x200 sleepq_switch(c74e8690,0,c0c9862c,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f66c80,44,c0cbb3f1,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f66c80,c0f66c24,44,c0cbb3f1,3e8,...) at _sleep+0x339 softdep_flush(0,f423bd38,c0c8f643,343,c77832a8,...) at softdep_flush+0x244 fork_exit(c0ac04c0,0,f423bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf423bd70, ebp = 0 --- Tracing command vnlru pid 19 tid 100073 td 0xc74e88c0 sched_switch(c74e88c0,0,104,191,cf71deef,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,50,...) at mi_switch+0x200 sleepq_switch(c74e88c0,0,c0c9862c,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c7783550,50,c0ca261f,0,0,...) at sleepq_timedwait+0x6b _sleep(c7783550,c0f5b314,250,c0ca261f,3e8,...) at _sleep+0x339 vnlru_proc(0,f4238d38,c0c8f643,343,c7783550,...) at vnlru_proc+0xe7 fork_exit(c091dd00,0,f4238d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4238d70, ebp = 0 --- Tracing command syncer pid 18 tid 100072 td 0xc74e8af0 sched_switch(c74e8af0,0,104,191,cf77669c,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c74e8af0,0,c0c9862c,26e,c74e8af0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f5b354,0,f4235c88,1,0,...) at sleepq_timedwait+0x6b _cv_timedwait(c0f5b354,c0f5b340,3e8,6ce,4e20,...) at _cv_timedwait+0x250 sched_sync(0,f4235d38,c0c8f643,343,c77837f8,...) at sched_sync+0x502 fork_exit(c091d130,0,f4235d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4235d70, ebp = 0 --- Tracing command bufdaemon pid 17 tid 100071 td 0xc74e8d20 sched_switch(c74e8d20,0,104,191,cf719367,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,44,...) at mi_switch+0x200 sleepq_switch(c74e8d20,0,c0c9862c,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f5b088,44,c0c9fb98,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f5b088,c0f5b08c,44,c0c9fb98,3e8,...) at _sleep+0x339 buf_daemon(0,f4232d38,c0c8f643,343,c7783aa0,...) at buf_daemon+0x138 fork_exit(c0905390,0,f4232d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4232d70, ebp = 0 --- Tracing command pagezero pid 16 tid 100070 td 0xc74ea000 sched_switch(c74ea000,0,104,191,4377add8,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c74ea000,0,c0c9862c,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f67a94,0,c0cc11b8,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f67a94,c0f67580,0,c0cc11b8,493e0,...) at _sleep+0x339 vm_pagezero(0,f422fd38,c0c8f643,343,c7783d48,...) at vm_pagezero+0xdc fork_exit(c0b00bf0,0,f422fd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf422fd70, ebp = 0 --- Tracing command vmdaemon pid 15 tid 100069 td 0xc74ea230 sched_switch(c74ea230,0,104,191,43727c53,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,68,...) at mi_switch+0x200 sleepq_switch(c74ea230,0,c0c9862c,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c0f676c4,68,c0c9fb98,0,0,...) at sleepq_wait+0x63 _sleep(c0f676c4,c0f676c8,68,c0c9fb98,0,...) at _sleep+0x36b vm_daemon(0,f422cd38,c0c8f643,343,c71782a8,...) at vm_daemon+0x59 fork_exit(c0afa010,0,f422cd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf422cd70, ebp = 0 --- Tracing command pagedaemon pid 9 tid 100068 td 0xc74ea460 sched_switch(c74ea460,0,104,191,cf5c4ac7,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,44,...) at mi_switch+0x200 sleepq_switch(c74ea460,0,c0c9862c,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f6768c,44,c0c9fb98,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f6768c,c0f67580,44,c0c9fb98,1388,...) at _sleep+0x339 vm_pageout(0,f4229d38,c0c8f643,343,c7178550,...) at vm_pageout+0x2bb fork_exit(c0afaeb0,0,f4229d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4229d70, ebp = 0 --- Tracing command sctp_iterator pid 8 tid 100067 td 0xc74ea690 sched_switch(c74ea690,0,104,191,1b996b11,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c74ea690,0,c0c9862c,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c0f5ce7c,0,c0cad9c1,0,0,...) at sleepq_wait+0x63 _sleep(c0f5ce7c,c0f5cd90,0,c0cad9c1,0,...) at _sleep+0x36b sctp_iterator_thread(0,f41c6d38,c0c8f643,343,c71787f8,...) at sctp_iterator_thread+0x60 fork_exit(c09a6f90,0,f41c6d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41c6d70, ebp = 0 --- Tracing command fdc0 pid 7 tid 100064 td 0xc74ead20 sched_switch(c74ead20,0,104,191,d01ba9d5,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c74ead20,0,c0c9862c,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c73c0c3c,4c,c0c89e2b,0,0,...) at sleepq_timedwait+0x6b _sleep(c73c0c3c,c73c0cf0,4c,c0c89e2b,3e8,...) at _sleep+0x339 fdc_thread(c73c0c00,f41bdd38,c0c8f643,343,c7178aa0,...) at fdc_thread+0x27d fork_exit(c0b7e170,c73c0c00,f41bdd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41bdd70, ebp = 0 --- Tracing command fw0_probe pid 6 tid 100062 td 0xc73ba460 sched_switch(c73ba460,0,104,191,42e9746b,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,5c,...) at mi_switch+0x200 sleepq_switch(c73ba460,0,c0c9862c,18b,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0c9862c,15b,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c73f5000,5c,c0c89e2b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c73f5000,c73f9488,15c,c0c89e2b,0,...) at _sleep+0x354 fw_bus_probe_thread(c73f5000,f41add38,c0c8f643,343,c7178d48,...) at fw_bus_probe_thread+0xa08 fork_exit(c0657b60,c73f5000,f41add38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41add70, ebp = 0 --- Tracing command usb pid 14 tid 100058 td 0xc73bad20 sched_switch(c73bad20,0,104,191,1e011f6c,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73bad20,0,c0c9862c,24b,c73bad20,...) at sleepq_switch+0x15f sleepq_wait(c73d4d0c,0,f4196cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73d4d0c,c73d4dac,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73d4d04,f4196d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73d4d04,f4196d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4196d70, ebp = 0 --- Tracing command usb pid 14 tid 100057 td 0xc73cc000 sched_switch(c73cc000,0,104,191,89296ff4,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73cc000,0,c0c9862c,24b,c73cc000,...) at sleepq_switch+0x15f sleepq_wait(c73d4cdc,0,f4193cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73d4cdc,c73d4dac,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73d4cd4,f4193d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73d4cd4,f4193d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4193d70, ebp = 0 --- Tracing command usb pid 14 tid 100056 td 0xc73cc230 sched_switch(c73cc230,0,104,191,1d9a6e4a,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73cc230,0,c0c9862c,24b,c73cc230,...) at sleepq_switch+0x15f sleepq_wait(c73d4cac,0,f4190cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73d4cac,c73d4dac,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73d4ca4,f4190d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73d4ca4,f4190d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4190d70, ebp = 0 --- Tracing command usb pid 14 tid 100055 td 0xc73cc460 sched_switch(c73cc460,0,104,191,1d9a5dcb,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73cc460,0,c0c9862c,24b,c73cc460,...) at sleepq_switch+0x15f sleepq_wait(c73d4c7c,0,f418dcb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73d4c7c,c73d4dac,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73d4c74,f418dd38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73d4c74,f418dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf418dd70, ebp = 0 --- Tracing command usb pid 14 tid 100053 td 0xc73cc8c0 sched_switch(c73cc8c0,0,104,191,1d9a4738,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73cc8c0,0,c0c9862c,24b,c73cc8c0,...) at sleepq_switch+0x15f sleepq_wait(c73c6b5c,0,f4185cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c6b5c,c73c6bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73c6b54,f4185d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73c6b54,f4185d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4185d70, ebp = 0 --- Tracing command usb pid 14 tid 100052 td 0xc73ccaf0 sched_switch(c73ccaf0,0,104,191,81379d3c,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73ccaf0,0,c0c9862c,24b,c73ccaf0,...) at sleepq_switch+0x15f sleepq_wait(c73c6b2c,0,f4182cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c6b2c,c73c6bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73c6b24,f4182d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73c6b24,f4182d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4182d70, ebp = 0 --- Tracing command usb pid 14 tid 100051 td 0xc73ccd20 sched_switch(c73ccd20,0,104,191,1d3616c9,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73ccd20,0,c0c9862c,24b,c73ccd20,...) at sleepq_switch+0x15f sleepq_wait(c73c6afc,0,f417fcb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c6afc,c73c6bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73c6af4,f417fd38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73c6af4,f417fd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf417fd70, ebp = 0 --- Tracing command usb pid 14 tid 100050 td 0xc736c690 sched_switch(c736c690,0,104,191,1d3602be,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736c690,0,c0c9862c,24b,c736c690,...) at sleepq_switch+0x15f sleepq_wait(c73c6acc,0,f417ccb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c6acc,c73c6bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73c6ac4,f417cd38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73c6ac4,f417cd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf417cd70, ebp = 0 --- Tracing command usb pid 14 tid 100049 td 0xc736c8c0 sched_switch(c736c8c0,0,104,191,1d35ee6c,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736c8c0,0,c0c9862c,24b,c736c8c0,...) at sleepq_switch+0x15f sleepq_wait(c73c2b5c,0,f4178cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c2b5c,c73c2bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73c2b54,f4178d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73c2b54,f4178d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4178d70, ebp = 0 --- Tracing command usb pid 14 tid 100048 td 0xc736caf0 sched_switch(c736caf0,0,104,191,80e52abb,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736caf0,0,c0c9862c,24b,c736caf0,...) at sleepq_switch+0x15f sleepq_wait(c73c2b2c,0,f4175cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c2b2c,c73c2bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73c2b24,f4175d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73c2b24,f4175d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4175d70, ebp = 0 --- Tracing command usb pid 14 tid 100047 td 0xc736cd20 sched_switch(c736cd20,0,104,191,1cd1e327,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736cd20,0,c0c9862c,24b,c736cd20,...) at sleepq_switch+0x15f sleepq_wait(c73c2afc,0,f4172cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c2afc,c73c2bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73c2af4,f4172d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73c2af4,f4172d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4172d70, ebp = 0 --- Tracing command usb pid 14 tid 100046 td 0xc73b9000 sched_switch(c73b9000,0,104,191,1cd1d014,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9000,0,c0c9862c,24b,c73b9000,...) at sleepq_switch+0x15f sleepq_wait(c73c2acc,0,f416fcb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c2acc,c73c2bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73c2ac4,f416fd38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73c2ac4,f416fd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf416fd70, ebp = 0 --- Tracing command usb pid 14 tid 100045 td 0xc73b9230 sched_switch(c73b9230,0,104,191,1cd1bba4,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9230,0,c0c9862c,24b,c73b9230,...) at sleepq_switch+0x15f sleepq_wait(c73bbb5c,0,f416bcb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73bbb5c,c73bbbfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73bbb54,f416bd38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73bbb54,f416bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf416bd70, ebp = 0 --- Tracing command usb pid 14 tid 100044 td 0xc73b9460 sched_switch(c73b9460,0,104,191,8092bb57,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9460,0,c0c9862c,24b,c73b9460,...) at sleepq_switch+0x15f sleepq_wait(c73bbb2c,0,f4168cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73bbb2c,c73bbbfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73bbb24,f4168d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73bbb24,f4168d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4168d70, ebp = 0 --- Tracing command usb pid 14 tid 100043 td 0xc73b9690 sched_switch(c73b9690,0,104,191,1c6dac15,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9690,0,c0c9862c,24b,c73b9690,...) at sleepq_switch+0x15f sleepq_wait(c73bbafc,0,f4165cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73bbafc,c73bbbfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73bbaf4,f4165d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73bbaf4,f4165d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4165d70, ebp = 0 --- Tracing command usb pid 14 tid 100042 td 0xc73b98c0 sched_switch(c73b98c0,0,104,191,1c6d994d,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b98c0,0,c0c9862c,24b,c73b98c0,...) at sleepq_switch+0x15f sleepq_wait(c73bbacc,0,f4162cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73bbacc,c73bbbfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73bbac4,f4162d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73bbac4,f4162d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4162d70, ebp = 0 --- Tracing command usb pid 14 tid 100040 td 0xc73b9d20 sched_switch(c73b9d20,0,104,191,1c6d8555,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9d20,0,c0c9862c,24b,c73b9d20,...) at sleepq_switch+0x15f sleepq_wait(c73b6b5c,0,f415bcb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73b6b5c,c73b6bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73b6b54,f415bd38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73b6b54,f415bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf415bd70, ebp = 0 --- Tracing command usb pid 14 tid 100039 td 0xc73ba000 sched_switch(c73ba000,0,104,191,805bc834,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73ba000,0,c0c9862c,24b,c73ba000,...) at sleepq_switch+0x15f sleepq_wait(c73b6b2c,0,f4158cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73b6b2c,c73b6bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73b6b24,f4158d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73b6b24,f4158d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4158d70, ebp = 0 --- Tracing command usb pid 14 tid 100038 td 0xc7350d20 sched_switch(c7350d20,0,104,191,1c09555b,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c7350d20,0,c0c9862c,24b,c7350d20,...) at sleepq_switch+0x15f sleepq_wait(c73b6afc,0,f4155cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73b6afc,c73b6bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73b6af4,f4155d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73b6af4,f4155d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4155d70, ebp = 0 --- Tracing command usb pid 14 tid 100037 td 0xc736a000 sched_switch(c736a000,0,104,191,1c09419d,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736a000,0,c0c9862c,24b,c736a000,...) at sleepq_switch+0x15f sleepq_wait(c73b6acc,0,f4152cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73b6acc,c73b6bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73b6ac4,f4152d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73b6ac4,f4152d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4152d70, ebp = 0 --- Tracing command usb pid 14 tid 100035 td 0xc736a460 sched_switch(c736a460,0,104,191,1c092c31,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736a460,0,c0c9862c,24b,c736a460,...) at sleepq_switch+0x15f sleepq_wait(c73a7b5c,0,f414bcb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73a7b5c,c73a7bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73a7b54,f414bd38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73a7b54,f414bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf414bd70, ebp = 0 --- Tracing command usb pid 14 tid 100034 td 0xc736a690 sched_switch(c736a690,0,104,191,80095b26,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736a690,0,c0c9862c,24b,c736a690,...) at sleepq_switch+0x15f sleepq_wait(c73a7b2c,0,f4148cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73a7b2c,c73a7bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73a7b24,f4148d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73a7b24,f4148d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4148d70, ebp = 0 --- Tracing command usb pid 14 tid 100033 td 0xc736a8c0 sched_switch(c736a8c0,0,104,191,1b9e0a61,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736a8c0,0,c0c9862c,24b,c736a8c0,...) at sleepq_switch+0x15f sleepq_wait(c73a7afc,0,f4145cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73a7afc,c73a7bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73a7af4,f4145d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73a7af4,f4145d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4145d70, ebp = 0 --- Tracing command usb pid 14 tid 100032 td 0xc736aaf0 sched_switch(c736aaf0,0,104,191,1b9df846,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736aaf0,0,c0c9862c,24b,c736aaf0,...) at sleepq_switch+0x15f sleepq_wait(c73a7acc,0,f4142cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73a7acc,c73a7bfc,c0c82c0c,6a,c0df2800,...) at _cv_wait+0x240 usb_process(c73a7ac4,f4142d38,c0c8f643,343,c734f000,...) at usb_process+0x193 fork_exit(c07bbfe0,c73a7ac4,f4142d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4142d70, ebp = 0 --- Tracing command xpt_thrd pid 5 tid 100021 td 0xc7350460 sched_switch(c7350460,0,104,191,1b9dde94,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c7350460,0,c0c9862c,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c0dbacd4,4c,c0c2e97a,0,0,...) at sleepq_wait+0x63 _sleep(c0dbacd4,c0dbacec,4c,c0c2e97a,0,...) at _sleep+0x36b xpt_scanner_thread(0,c6e3bd38,c0c8f643,343,c734f2a8,...) at xpt_scanner_thread+0x4a fork_exit(c0484130,0,c6e3bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e3bd70, ebp = 0 --- Tracing command yarrow pid 13 tid 100017 td 0xc717b230 sched_switch(c717b230,0,104,191,d4670427,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c717b230,0,c0c9862c,26e,2,...) at sleepq_switch+0x15f sleepq_timedwait(c0dee8e4,0,c0c89e2b,2,0,...) at sleepq_timedwait+0x6b _sleep(c0dee8e4,0,0,c0c89e2b,64,...) at _sleep+0x339 pause(c0c89e2b,64,c0c76a5f,111,0,...) at pause+0x47 random_kthread(0,c6e2fd38,c0c8f643,343,c734f550,...) at random_kthread+0x1ef fork_exit(c07343a0,0,c6e2fd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e2fd70, ebp = 0 --- Tracing command g_down pid 4 tid 100015 td 0xc717b690 sched_switch(c717b690,0,104,191,da541146,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c717b690,0,c0c9862c,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c0dec6c4,4c,c0c89e2b,0,0,...) at sleepq_wait+0x63 _sleep(c0dec6c4,c0dec628,24c,c0c89e2b,0,...) at _sleep+0x36b g_io_schedule_down(c717b690,0,c0c8b4f3,74,0,...) at g_io_schedule_down+0x56 g_down_procbody(0,c6e29d38,c0c8f643,343,c7177000,...) at g_down_procbody+0x8d fork_exit(c08263f0,0,c6e29d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e29d70, ebp = 0 --- Tracing command g_up pid 3 tid 100014 td 0xc717b8c0 sched_switch(c717b8c0,0,104,191,da5e94ba,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c717b8c0,0,c0c9862c,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c0dec6c0,4c,c0c89e2b,0,0,...) at sleepq_wait+0x63 _sleep(c0dec6c0,c0dec648,24c,c0c89e2b,0,...) at _sleep+0x36b g_io_schedule_up(c717b8c0,0,c0c8b4f3,5d,0,...) at g_io_schedule_up+0x11e g_up_procbody(0,c6e26d38,c0c8f643,343,c71772a8,...) at g_up_procbody+0x8d fork_exit(c0826480,0,c6e26d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e26d70, ebp = 0 --- Tracing command g_event pid 2 tid 100013 td 0xc717baf0 sched_switch(c717baf0,0,104,191,d9545c7a,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c717baf0,0,c0c9862c,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0dec6b8,4c,c0c89e2b,0,0,...) at sleepq_timedwait+0x6b _sleep(c0dec6b8,0,4c,c0c89e2b,64,...) at _sleep+0x339 g_event_procbody(0,c6e23d38,c0c8f643,343,c7177550,...) at g_event_procbody+0xcb fork_exit(c0826510,0,c6e23d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e23d70, ebp = 0 --- Tracing command intr pid 12 tid 100066 td 0xc74ea8c0 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100065 td 0xc74eaaf0 sched_switch(c74eaaf0,0,109,191,1dfedb46,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c7175070,...) at mi_switch+0x200 ithread_loop(c74e1390,f41c0d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c74e1390,f41c0d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41c0d70, ebp = 0 --- Tracing command intr pid 12 tid 100063 td 0xc73ba230 sched_switch(c73ba230,0,109,191,ce1d2626,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c74dc070,...) at mi_switch+0x200 ithread_loop(c74e1410,f41b0d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c74e1410,f41b0d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41b0d70, ebp = 0 --- Tracing command intr pid 12 tid 100060 td 0xc73ba8c0 sched_switch(c73ba8c0,0,109,191,1b5bb708,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71be0f0,...) at mi_switch+0x200 ithread_loop(c73ecc00,f41a4d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c73ecc00,f41a4d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41a4d70, ebp = 0 --- Tracing command intr pid 12 tid 100059 td 0xc73baaf0 sched_switch(c73baaf0,0,109,191,28733446,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71be3f0,...) at mi_switch+0x200 ithread_loop(c73ec460,f419cd38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c73ec460,f419cd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf419cd70, ebp = 0 --- Tracing command intr pid 12 tid 100054 td 0xc73cc690 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100041 td 0xc73b9af0 sched_switch(c73b9af0,0,109,191,461b4352,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71be1f0,...) at mi_switch+0x200 ithread_loop(c739e710,f415fd38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c739e710,f415fd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf415fd70, ebp = 0 --- Tracing command intr pid 12 tid 100036 td 0xc736a230 sched_switch(c736a230,0,109,191,458466ff,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71be270,...) at mi_switch+0x200 ithread_loop(c739e980,f414fd38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c739e980,f414fd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf414fd70, ebp = 0 --- Tracing command intr pid 12 tid 100031 td 0xc736ad20 sched_switch(c736ad20,0,109,191,44d0a783,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71be2f0,...) at mi_switch+0x200 ithread_loop(c73ad120,f413fd38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c73ad120,f413fd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf413fd70, ebp = 0 --- Tracing command intr pid 12 tid 100030 td 0xc736c000 sched_switch(c736c000,0,109,191,da5da43f,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71bdef0,...) at mi_switch+0x200 ithread_loop(c739e510,c6f89d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c739e510,c6f89d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6f89d70, ebp = 0 --- Tracing command intr pid 12 tid 100029 td 0xc736c230 sched_switch(c736c230,0,109,191,2db46b15,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c738c2f0,...) at mi_switch+0x200 ithread_loop(c738d8e0,c6e83d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c738d8e0,c6e83d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e83d70, ebp = 0 --- Tracing command intr pid 12 tid 100028 td 0xc736c460 sched_switch(c736c460,0,109,191,1b9a32c1,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c7174b70,...) at mi_switch+0x200 ithread_loop(c7176610,c6e77d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c7176610,c6e77d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e77d70, ebp = 0 --- Tracing command intr pid 12 tid 100027 td 0xc71bf690 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100022 td 0xc7350230 sched_switch(c7350230,0,109,191,41fe55bf,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c73518f0,...) at mi_switch+0x200 ithread_loop(c7176390,c6e3ed38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c7176390,c6e3ed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e3ed70, ebp = 0 --- Tracing command intr pid 12 tid 100020 td 0xc7350690 sched_switch(c7350690,0,109,191,2cf50f45,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c7351a70,...) at mi_switch+0x200 ithread_loop(c710ca30,c6e38d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c710ca30,c6e38d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e38d70, ebp = 0 --- Tracing command intr pid 12 tid 100019 td 0xc73508c0 sched_switch(c73508c0,0,109,191,1dff0129,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71bd070,...) at mi_switch+0x200 ithread_loop(c710ca40,c6e35d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c710ca40,c6e35d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e35d70, ebp = 0 --- Tracing command intr pid 12 tid 100012 td 0xc717bd20 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100011 td 0xc71bf000 sched_switch(c71bf000,0,109,191,d031ea35,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71bdbf0,...) at mi_switch+0x200 ithread_loop(c71761d0,c6e1dd38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c71761d0,c6e1dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e1dd70, ebp = 0 --- Tracing command intr pid 12 tid 100010 td 0xc71bf230 sched_switch(c71bf230,0,109,191,cf77bf4a,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71bdc70,...) at mi_switch+0x200 ithread_loop(c71761e0,c6e1ad38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c71761e0,c6e1ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e1ad70, ebp = 0 --- Tracing command intr pid 12 tid 100009 td 0xc71bf460 sched_switch(c71bf460,0,109,191,d954511c,...) at sched_switch+0x406 mi_switch(109,0,c0c8f8c2,52d,c71bdcf0,...) at mi_switch+0x200 ithread_loop(c71761f0,c6e17d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c08626c0,c71761f0,c6e17d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e17d70, ebp = 0 --- Tracing command intr pid 12 tid 100008 td 0xc7179000 cpustop_handler(4,c6e14b80,c0bc2a96,c0df2800,c0c95d59,...) at cpustop_handler+0x32 ipi_nmi_handler(c0df2800,c0c95d59,46,2,c71777f8,...) at ipi_nmi_handler+0x2f trap(c6e14b8c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc04f36a3, esp = 0xc6e14bcc, ebp = 0xc6e14bcc --- acpi_timer_read(c0ce4aa0,c0deeac0,c6e14c14,c08954dd,c0ce4aa0,...) at acpi_timer_read+0x13 acpi_timer_get_timecount_safe(c0ce4aa0,c7179000,c6e14bf8,246,c0deeac0,...) at acpi_timer_get_timecount_safe+0x18 binuptime(c6e14c88,0,c0c95596,176,4b3,...) at binuptime+0x3d softclock(c0deeac0,c6e14cc8,c08794f4,c0df3500,c71bdd38,...) at softclock+0x223 intr_event_execute_handlers(c71777f8,c71bdd00,c0c8f8c2,533,c71bdd70,...) at intr_event_execute_handlers+0x125 ithread_loop(c7176200,c6e14d38,c0c8f643,343,c71777f8,...) at ithread_loop+0x9f fork_exit(c08626c0,c7176200,c6e14d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e14d70, ebp = 0 --- Tracing command intr pid 12 tid 100007 td 0xc7179230 fork_trampoline() at fork_trampoline Tracing command idle pid 11 tid 100006 td 0xc7179460 sched_switch(c7179460,0,60c,18c,daa7b5ec,...) at sched_switch+0x406 mi_switch(60c,0,c0c95d59,813,0,...) at mi_switch+0x200 sched_preempt(c7179460,0,1f4,c6e0dc6c,c0ba531e,...) at sched_preempt+0x9f ipi_bitmap_handler(8,28,28,c73c0418,c73c0400,...) at ipi_bitmap_handler+0x34 Xipi_intr_bitmap_handler() at Xipi_intr_bitmap_handler+0x2e --- interrupt, eip = 0xc0b99415, esp = 0xc6e0dc6c, ebp = 0xc6e0dc6c --- acpi_cpu_c1(0,c6e0dcd4,0,ffffffff,c6e0dcb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(2710,c0df2800,c6e0dcb4,c0bb0b6b,1,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(1,c6e0dcf8,c08ac57e,1,c6e0dcd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(1,c6e0dcd4,c0c95d59,a06,c7179460,...) at cpu_idle+0x1b sched_idletd(0,c6e0dd38,c0c8f643,343,c7177aa0,...) at sched_idletd+0x23e fork_exit(c08ac340,0,c6e0dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e0dd70, ebp = 0 --- Tracing command idle pid 11 tid 100005 td 0xc7179690 cpustop_handler(2,c6e0ac20,c0bc2a96,c7179690,c73e7c20,...) at cpustop_handler+0x32 ipi_nmi_handler(c7179690,c73e7c20,c7179690,c6e0abac,c7177aa0,...) at ipi_nmi_handler+0x2f trap(c6e0ac2c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc0b99415, esp = 0xc6e0ac6c, ebp = 0xc6e0ac6c --- acpi_cpu_c1(30,c6e0ac7c,1,28,28,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(2710,c0df2e80,c6e0acb4,c0bb0b6b,1,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(1,c6e0acf8,c08ac57e,1,c6e0acd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(1,c6e0acd4,c0c95d59,a06,c7179690,...) at cpu_idle+0x1b sched_idletd(0,c6e0ad38,c0c8f643,343,c7177aa0,...) at sched_idletd+0x23e fork_exit(c08ac340,0,c6e0ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e0ad70, ebp = 0 --- Tracing command idle pid 11 tid 100004 td 0xc71798c0 sched_switch(c71798c0,0,60c,18c,db69e806,...) at sched_switch+0x406 mi_switch(60c,0,c0c95d59,813,2,...) at mi_switch+0x200 sched_preempt(c71798c0,2,1f4,c6e07c6c,c0ba531e,...) at sched_preempt+0x9f ipi_bitmap_handler(8,28,28,c728de18,c728de00,...) at ipi_bitmap_handler+0x34 Xipi_intr_bitmap_handler() at Xipi_intr_bitmap_handler+0x2e --- interrupt, eip = 0xc0b99415, esp = 0xc6e07c6c, ebp = 0xc6e07c6c --- acpi_cpu_c1(28,c6e07cd4,2,ffffffff,c6e07cb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(ffffffff,0,c6e07cb4,c0bb0b6b,0,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(0,c6e07cf8,c08ac57e,0,c6e07cd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(0,c6e07cd4,c0c95d59,a06,c71798c0,...) at cpu_idle+0x1b sched_idletd(0,c6e07d38,c0c8f643,343,c7177aa0,...) at sched_idletd+0x23e fork_exit(c08ac340,0,c6e07d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e07d70, ebp = 0 --- Tracing command idle pid 11 tid 100003 td 0xc7179af0 cpustop_handler(8,c6e04c20,c0bc2a96,c6e04bb0,c08794f4,...) at cpustop_handler+0x32 ipi_nmi_handler(c6e04bb0,c08794f4,c0deeb68,4,c7177aa0,...) at ipi_nmi_handler+0x2f trap(c6e04c2c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc0b99415, esp = 0xc6e04c6c, ebp = 0xc6e04c6c --- acpi_cpu_c1(32,c6e04cd4,3,ffffffff,c6e04cb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(ffffffff,0,c6e04cb4,c0bb0b6b,1,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(1,c6e04cf8,c08ac57e,1,c6e04cd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(1,c6e04cd4,c0c95d59,a06,c7179af0,...) at cpu_idle+0x1b sched_idletd(0,c6e04d38,c0c8f643,343,c7177aa0,...) at sched_idletd+0x23e fork_exit(c08ac340,0,c6e04d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e04d70, ebp = 0 --- Tracing command init pid 1 tid 100002 td 0xc7179d20 sched_switch(c7179d20,0,104,191,ce2f6b20,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,5c,...) at mi_switch+0x200 sleepq_switch(c7179d20,0,c0c9862c,18b,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0c9862c,15b,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c7177d48,5c,c0c9ae0b,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7177d48,c7177dd0,15c,c0c9ae0b,0,...) at _sleep+0x354 kern_wait(c7179d20,ffffffff,c6e00c74,2,0,...) at kern_wait+0xb76 wait4(c7179d20,c6e00cf8,10,c7179d20,c0d7d464,...) at wait4+0x3b syscall(c6e00d38) at syscall+0x2b4 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x8054b8f, esp = 0xbfbfe8ac, ebp = 0xbfbfe8c8 --- Tracing command audit pid 10 tid 100001 td 0xc717b000 sched_switch(c717b000,0,104,191,1b9b8ea4,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c717b000,0,c0c9862c,24b,c717b000,...) at sleepq_switch+0x15f sleepq_wait(c0f665a0,0,c6dfdc9c,1,0,...) at sleepq_wait+0x63 _cv_wait(c0f665a0,c0f66584,c0cb8673,194,0,...) at _cv_wait+0x240 audit_worker(0,c6dfdd38,c0c8f643,343,c7178000,...) at audit_worker+0x84 fork_exit(c0a8f8d0,0,c6dfdd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6dfdd70, ebp = 0 --- Tracing command kernel pid 0 tid 100061 td 0xc73ba690 sched_switch(c73ba690,0,104,191,d01d0bab,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73ba690,0,c0c9862c,24b,c73ba690,...) at sleepq_switch+0x15f sleepq_wait(c73a0840,0,c0c94dc5,c0c89e2b,0,...) at sleepq_wait+0x63 msleep_spin(c73a0840,c73a0858,c0c89e2b,0,c0c928fa,...) at msleep_spin+0x21d taskqueue_thread_loop(c73f949c,f41aad38,c0c8f643,343,c0dec780,...) at taskqueue_thread_loop+0x94 fork_exit(c08c5760,c73f949c,f41aad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41aad70, ebp = 0 --- Tracing command kernel pid 0 tid 100026 td 0xc71bf8c0 sched_switch(c71bf8c0,0,104,191,1e1170ab,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c71bf8c0,0,c0c9862c,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c734d080,0,c0c89e2b,0,0,...) at sleepq_wait+0x63 _sleep(c734d080,c734d098,0,c0c89e2b,0,...) at _sleep+0x36b taskqueue_thread_loop(c0ded010,c6e4ad38,c0c8f643,343,c0dec780,...) at taskqueue_thread_loop+0xba fork_exit(c08c5760,c0ded010,c6e4ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e4ad70, ebp = 0 --- Tracing command kernel pid 0 tid 100025 td 0xc71bfaf0 sched_switch(c71bfaf0,0,104,191,1e115dbf,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c71bfaf0,0,c0c9862c,24b,c71bfaf0,...) at sleepq_switch+0x15f sleepq_wait(c734d0c0,0,c0c94dc5,c0c89e2b,0,...) at sleepq_wait+0x63 msleep_spin(c734d0c0,c734d0d8,c0c89e2b,0,c0c928fa,...) at msleep_spin+0x21d taskqueue_thread_loop(c0dbdb00,c6e47d38,c0c8f643,343,c0dec780,...) at taskqueue_thread_loop+0x94 fork_exit(c08c5760,c0dbdb00,c6e47d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e47d70, ebp = 0 --- Tracing command kernel pid 0 tid 100024 td 0xc71bfd20 sched_switch(c71bfd20,0,104,191,1e114ff1,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c71bfd20,0,c0c9862c,24b,c71bfd20,...) at sleepq_switch+0x15f sleepq_wait(c734d0c0,0,c0c94dc5,c0c89e2b,0,...) at sleepq_wait+0x63 msleep_spin(c734d0c0,c734d0d8,c0c89e2b,0,c0c928fa,...) at msleep_spin+0x21d taskqueue_thread_loop(c0dbdb00,c6e44d38,c0c8f643,343,c0dec780,...) at taskqueue_thread_loop+0x94 fork_exit(c08c5760,c0dbdb00,c6e44d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e44d70, ebp = 0 --- Tracing command kernel pid 0 tid 100023 td 0xc7350000 sched_switch(c7350000,0,104,191,1e113d13,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c7350000,0,c0c9862c,24b,c7350000,...) at sleepq_switch+0x15f sleepq_wait(c734d0c0,0,c0c94dc5,c0c89e2b,0,...) at sleepq_wait+0x63 msleep_spin(c734d0c0,c734d0d8,c0c89e2b,0,c0c928fa,...) at msleep_spin+0x21d taskqueue_thread_loop(c0dbdb00,c6e41d38,c0c8f643,343,c0dec780,...) at taskqueue_thread_loop+0x94 fork_exit(c08c5760,c0dbdb00,c6e41d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e41d70, ebp = 0 --- Tracing command kernel pid 0 tid 100018 td 0xc7350af0 sched_switch(c7350af0,0,104,191,420100b6,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c7350af0,0,c0c9862c,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c734d500,0,c0c89e2b,0,0,...) at sleepq_wait+0x63 _sleep(c734d500,c734d518,0,c0c89e2b,0,...) at _sleep+0x36b taskqueue_thread_loop(c0e01288,c6e32d38,c0c8f643,343,c0dec780,...) at taskqueue_thread_loop+0xba fork_exit(c08c5760,c0e01288,c6e32d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e32d70, ebp = 0 --- Tracing command kernel pid 0 tid 100016 td 0xc717b460 sched_switch(c717b460,0,104,191,4712c74a,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,0,...) at mi_switch+0x200 sleepq_switch(c717b460,0,c0c9862c,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c715ed40,0,c0c89e2b,0,0,...) at sleepq_wait+0x63 _sleep(c715ed40,c715ed58,0,c0c89e2b,0,...) at _sleep+0x36b taskqueue_thread_loop(c0dffd20,c6e2cd38,c0c8f643,343,c0dec780,...) at taskqueue_thread_loop+0xba fork_exit(c08c5760,c0dffd20,c6e2cd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e2cd70, ebp = 0 --- Tracing command kernel pid 0 tid 100000 td 0xc0deca30 sched_switch(c0deca30,0,104,191,cf767013,...) at sched_switch+0x406 mi_switch(104,0,c0c9862c,1d6,44,...) at mi_switch+0x200 sleepq_switch(c0deca30,0,c0c9862c,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0dec780,44,c0c965ce,0,0,...) at sleepq_timedwait+0x6b _sleep(c0dec780,0,44,c0c965ce,2710,...) at _sleep+0x339 scheduler(0,141ec00,141ec00,141e000,1425000,...) at scheduler+0x23e mi_startup() at mi_startup+0x96 begin() at begin+0x2c db> call doadump Physical memory: 3439 MB Dumping 98 MB: 83 67 51 35 19 3 Dump complete = 0xf db> reset (kgdb) bt #0 doadump () at pcpu.h:246 #1 0xc04cee29 in db_fncall (dummy1=0x1, dummy2=0x0, dummy3=0xc0fbb3e0, dummy4=0xf643a838 "") at ../../../ddb/db_command.c:548 #2 0xc04cf221 in db_command (last_cmdp=0xc0dbbcdc, cmd_table=0x0, dopager=0x1) at ../../../ddb/db_command.c:445 #3 0xc04cf37a in db_command_loop () at ../../../ddb/db_command.c:498 #4 0xc04d120d in db_trap (type=0x3, code=0x0) at ../../../ddb/db_main.c:229 #5 0xc08b8ea6 in kdb_trap (type=0x3, code=0x0, tf=0xf643a9e0) at ../../../kern/subr_kdb.c:535 #6 0xc0bc308b in trap (frame=0xf643a9e0) at ../../../i386/i386/trap.c:690 #7 0xc0ba4c2b in calltrap () at ../../../i386/i386/exception.s:165 #8 0xc08b902a in kdb_enter (why=0xc0c941c3 "panic", msg=0xc0c941c3 "panic") at cpufunc.h:71 #9 0xc0889806 in panic (fmt=0xc0cbbfea "ffs_read: UIO_USERSPACE") at ../../../kern/kern_shutdown.c:562 #10 0xc0ac9967 in ffs_read (ap=0xf643ab30) at ../../../ufs/ffs/ffs_vnops.c:466 #11 0xc0bd94e5 in VOP_READ_APV (vop=0xc0d9f0c0, a=0xf643ab30) at vnode_if.c:887 #12 0xc0929b31 in vn_read_chunk (vp=0xc79466f4, uio=0xf643ac00, active_cred=0xc7175100, fcred=0xc7175100, ioflag=0x8) at vnode_if.h:384 #13 0xc0ad7ba2 in ufs_readdir (ap=0xf643ac20) at ../../../ufs/ufs/ufs_vnops.c:1903 #14 0xc0bd90f5 in VOP_READDIR_APV (vop=0xc0d9f600, a=0xf643ac20) at vnode_if.c:1737 #15 0xc0927694 in kern_getdirentries (td=0xc7804af0, fd=0x3, buf=0x28309000
, count=0x1000, basep=0xf643ac74) at vnode_if.h:758 #16 0xc0927871 in getdirentries (td=0xc7804af0, uap=0xf643acf8) at ../../../kern/vfs_syscalls.c:4051 #17 0xc0bc2814 in syscall (frame=0xf643ad38) at ../../../i386/i386/trap.c:1078 #18 0xc0ba4c90 in Xint0x80_syscall () at ../../../i386/i386/exception.s:261 #19 0x00000033 in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) f 10 #10 0xc0ac9967 in ffs_read (ap=0xf643ab30) at ../../../ufs/ffs/ffs_vnops.c:466 466 KASSERT(uio->uio_segflg != UIO_USERSPACE, ("ffs_read: UIO_USERSPACE")); (kgdb) l 461 error = ffs_rawread(vp, uio, &workdone); 462 if (error != 0 || workdone != 0) 463 return error; 464 } 465 #endif 466 KASSERT(uio->uio_segflg != UIO_USERSPACE, ("ffs_read: UIO_USERSPACE")); 467 seqcount = ap->a_ioflag >> IO_SEQSHIFT; 468 ip = VTOI(vp); 469 470 #ifdef INVARIANTS (kgdb) p *uio $1 = {uio_iov = 0xf643ac3c, uio_iovcnt = 0x1, uio_offset = 0x0, uio_resid = 0x1000, uio_segflg = UIO_USERSPACE, uio_rw = UIO_READ, uio_td = 0xc7804af0} (kgdb) $ git diff master diff --git a/sys/conf/files b/sys/conf/files index f5217db..a9ead10 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2009,6 +2009,7 @@ kern/kern_poll.c optional device_polling kern/kern_priv.c standard kern/kern_proc.c standard kern/kern_prot.c standard +kern/kern_rangelock.c standard kern/kern_resource.c standard kern/kern_rmlock.c standard kern/kern_rwlock.c standard @@ -2696,6 +2697,7 @@ vm/vm_page.c standard vm/vm_pageout.c standard vm/vm_pager.c standard vm/vm_phys.c standard +vm/vm_readwrite.c standard vm/vm_reserv.c standard vm/vm_unix.c standard vm/vm_zeroidle.c standard diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c new file mode 100644 index 0000000..00e5f4a --- /dev/null +++ b/sys/kern/kern_rangelock.c @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2009 Konstantin Belousov + * All rights reserved. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +uma_zone_t rl_entry_zone; + +static void +rangelock_sys_init(void) +{ + + rl_entry_zone = uma_zcreate("rl_entry", sizeof(struct rl_q_entry), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); +} +SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, rangelock_sys_init, NULL); + +void +rangelock_init(struct rangelock *lock) +{ + + TAILQ_INIT(&lock->rl_waiters); + lock->rl_currdep = NULL; +} + +void +rangelock_destroy(struct rangelock *lock) +{ + + KASSERT(TAILQ_EMPTY(&lock->rl_waiters), ("Dangling waiters")); +} + +static int +rangelock_incompatible(const struct rl_q_entry *e1, + const struct rl_q_entry *e2) +{ + + if ((e1->rl_q_flags & RL_LOCK_TYPE_MASK) == RL_LOCK_READ && + (e2->rl_q_flags & RL_LOCK_TYPE_MASK) == RL_LOCK_READ) + return (0); +#define IN_RANGE(a, e) (a <= e->rl_q_start && a < e->rl_q_end) + if (IN_RANGE(e1->rl_q_start, e2) || IN_RANGE(e2->rl_q_start, e1) || + IN_RANGE(e1->rl_q_end, e2) || IN_RANGE(e2->rl_q_end, e1)) + return (1); +#undef IN_RANGE + return (0); +} + +static void +rangelock_calc_block(struct rangelock *lock) +{ + struct rl_q_entry *entry, *entry1, *whead; + + if (lock->rl_currdep == TAILQ_FIRST(&lock->rl_waiters) && + lock->rl_currdep != NULL) + lock->rl_currdep = TAILQ_NEXT(lock->rl_currdep, rl_q_link); + for (entry = lock->rl_currdep; entry; + entry = TAILQ_NEXT(entry, rl_q_link)) { + TAILQ_FOREACH(entry1, &lock->rl_waiters, rl_q_link) { + if (rangelock_incompatible(entry, entry1)) + goto out; + if (entry1 == entry) + break; + } + } +out: + lock->rl_currdep = entry; + TAILQ_FOREACH(whead, &lock->rl_waiters, rl_q_link) { + if (whead == lock->rl_currdep) + break; + if (!(whead->rl_q_flags & RL_LOCK_GRANTED)) { + whead->rl_q_flags |= RL_LOCK_GRANTED; + wakeup(whead); + } + } +} + +static void +rangelock_unlock_vp_locked(struct vnode *vp, struct rl_q_entry *entry) +{ + + ASSERT_VI_LOCKED(vp, "rangelock"); + KASSERT(entry != vp->v_rl.rl_currdep, ("stuck currdep")); + TAILQ_REMOVE(&vp->v_rl.rl_waiters, entry, rl_q_link); + rangelock_calc_block(&vp->v_rl); + VI_UNLOCK(vp); + uma_zfree(rl_entry_zone, entry); +} + +void +rangelock_unlock(struct vnode *vp, void *cookie) +{ + struct rl_q_entry *entry; + + entry = cookie; + VI_LOCK(vp); + rangelock_unlock_vp_locked(vp, entry); +} + +void * +rangelock_unlock_range(struct vnode *vp, void *cookie, off_t base, size_t len) +{ + struct rl_q_entry *entry; + + entry = cookie; + VI_LOCK(vp); + KASSERT(entry->rl_q_flags & RL_LOCK_GRANTED, ("XXX")); + KASSERT(entry->rl_q_start == base, ("XXX")); + KASSERT(entry->rl_q_end >= base + len, ("XXX")); + if (entry->rl_q_end == base + len) { + rangelock_unlock_vp_locked(vp, cookie); + return (NULL); + } + entry->rl_q_end = base + len; + rangelock_calc_block(&vp->v_rl); + VI_UNLOCK(vp); + return (cookie); +} + +static void * +rangelock_enqueue(struct vnode *vp, struct rl_q_entry *entry) +{ + + VI_LOCK(vp); + TAILQ_INSERT_TAIL(&vp->v_rl.rl_waiters, entry, rl_q_link); + if (vp->v_rl.rl_currdep == NULL) + vp->v_rl.rl_currdep = entry; + rangelock_calc_block(&vp->v_rl); + while (!(entry->rl_q_flags & RL_LOCK_GRANTED)) + msleep(entry, &vp->v_interlock, 0, "range", 0); + VI_UNLOCK(vp); + return (entry); +} + +void * +rangelock_rlock(struct vnode *vp, off_t base, size_t len) +{ + struct rl_q_entry *entry; + + entry = uma_zalloc(rl_entry_zone, M_WAITOK); + entry->rl_q_flags = RL_LOCK_READ; + entry->rl_q_start = base; + entry->rl_q_end = base + len; + return (rangelock_enqueue(vp, entry)); +} + +void * +rangelock_wlock(struct vnode *vp, off_t base, size_t len) +{ + struct rl_q_entry *entry; + + entry = uma_zalloc(rl_entry_zone, M_WAITOK); + entry->rl_q_flags = RL_LOCK_WRITE; + entry->rl_q_start = base; + entry->rl_q_end = base + len; + return (rangelock_enqueue(vp, entry)); +} diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index d92555f..8aa145f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -853,6 +853,7 @@ vdestroy(struct vnode *vp) /* XXX Elsewhere we can detect an already freed vnode via NULL v_op. */ vp->v_op = NULL; #endif + rangelock_destroy(&vp->v_rl); lockdestroy(vp->v_vnlock); mtx_destroy(&vp->v_interlock); mtx_destroy(BO_MTX(bo)); @@ -1007,6 +1008,7 @@ alloc: if ((mp->mnt_kern_flag & MNTK_NOKNOTE) != 0) vp->v_vflag |= VV_NOKNOTE; } + rangelock_init(&vp->v_rl); *vpp = vp; return (0); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 03e8d93..6618bc8 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -62,6 +62,9 @@ __FBSDID("$FreeBSD$"); #include +#include +#include + static fo_rdwr_t vn_read; static fo_rdwr_t vn_write; static fo_truncate_t vn_truncate; @@ -351,74 +354,69 @@ sequential_heuristic(struct uio *uio, struct file *fp) * Package up an I/O request on a vnode into a uio and do it. */ int -vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred, - aresid, td) - enum uio_rw rw; - struct vnode *vp; - void *base; - int len; - off_t offset; - enum uio_seg segflg; - int ioflg; - struct ucred *active_cred; - struct ucred *file_cred; - int *aresid; - struct thread *td; +vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, + enum uio_seg segflg, int ioflg, struct ucred *active_cred, + struct ucred *file_cred, int *aresid, struct thread *td) { struct uio auio; struct iovec aiov; struct mount *mp; struct ucred *cred; + void *rl_cookie; int error, lock_flags; VFS_ASSERT_GIANT(vp->v_mount); + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + aiov.iov_base = base; + aiov.iov_len = len; + auio.uio_resid = len; + auio.uio_offset = offset; + auio.uio_segflg = segflg; + auio.uio_rw = rw; + auio.uio_td = td; + error = 0; + + if ((ioflg & IO_NODELOCKED) == 0) { + if (rw == UIO_READ) + rl_cookie = rangelock_rlock(vp, offset, len); + else + rl_cookie = rangelock_wlock(vp, offset, len); + } else + rl_cookie = NULL; + if ((ioflg & IO_NODELOCKED) == 0) { mp = NULL; if (rw == UIO_WRITE) { if (vp->v_type != VCHR && (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) - return (error); + goto out; if (MNT_SHARED_WRITES(mp) || - ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) { + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) lock_flags = LK_SHARED; - } else { + else lock_flags = LK_EXCLUSIVE; - } vn_lock(vp, lock_flags | LK_RETRY); - } else - vn_lock(vp, LK_SHARED | LK_RETRY); - + } } ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held"); - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - aiov.iov_base = base; - aiov.iov_len = len; - auio.uio_resid = len; - auio.uio_offset = offset; - auio.uio_segflg = segflg; - auio.uio_rw = rw; - auio.uio_td = td; - error = 0; #ifdef MAC if ((ioflg & IO_NOMACCHECK) == 0) { - if (rw == UIO_READ) - error = mac_vnode_check_read(active_cred, file_cred, - vp); - else + if (rw == UIO_WRITE) error = mac_vnode_check_write(active_cred, file_cred, vp); } #endif if (error == 0) { - if (file_cred) + if (file_cred != NULL) cred = file_cred; else cred = active_cred; if (rw == UIO_READ) - error = VOP_READ(vp, &auio, ioflg, cred); + error = vn_read_chunk(vp, &auio, active_cred, cred, + ioflg); else error = VOP_WRITE(vp, &auio, ioflg, cred); } @@ -428,10 +426,15 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred, if (auio.uio_resid && error == 0) error = EIO; if ((ioflg & IO_NODELOCKED) == 0) { - if (rw == UIO_WRITE && vp->v_type != VCHR) - vn_finished_write(mp); - VOP_UNLOCK(vp, 0); + if (rw == UIO_WRITE) { + if (vp->v_type != VCHR) + vn_finished_write(mp); + VOP_UNLOCK(vp, 0); + } } + out: + if (rl_cookie != NULL) + rangelock_unlock(vp, rl_cookie); return (error); } @@ -493,126 +496,149 @@ vn_rdwr_inchunks(rw, vp, base, len, offset, segflg, ioflg, active_cred, return (error); } +static struct mtx * +vn_lock_foffset(struct file *fp) +{ + struct mtx *mtxp; + + mtxp = mtx_pool_find(mtxpool_sleep, fp); + mtx_lock(mtxp); + while (fp->f_vnread_flags & FOFFSET_LOCKED) { + fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; + msleep(&fp->f_vnread_flags, mtxp, PUSER -1, + "vnread offlock", 0); + } + fp->f_vnread_flags |= FOFFSET_LOCKED; + mtx_unlock(mtxp); + return (mtxp); +} + +static void +vn_unlock_foffset(struct file *fp, struct mtx *mtxp) +{ + + mtx_lock(mtxp); + if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) + wakeup(&fp->f_vnread_flags); + fp->f_vnread_flags = 0; + mtx_unlock(mtxp); +} + +int +vn_read_chunk(struct vnode *vp, struct uio *uio, struct ucred *active_cred, + struct ucred *fcred, int ioflag) +{ + int error, vfslocked; + + error = 0; + vfslocked = 0; /* gcc */ + + if ((ioflag & IO_NODELOCKED) == 0) { + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_SHARED | LK_RETRY); + } + +#ifdef MAC + if ((ioflag & IO_NOMACCHECK) == 0) + error = mac_vnode_check_read(active_cred, fcred, vp); +#endif + if (error == 0) { + error = vnode_pager_read(vp, uio, ioflag); + if (error == EOPNOTSUPP) + error = VOP_READ(vp, uio, ioflag, fcred); + } + if ((ioflag & IO_NODELOCKED) == 0) { + VOP_UNLOCK(vp, 0); + VFS_UNLOCK_GIANT(vfslocked); + } + return (error); +} + /* * File table vnode read routine. */ static int -vn_read(fp, uio, active_cred, flags, td) - struct file *fp; - struct uio *uio; - struct ucred *active_cred; - struct thread *td; - int flags; +vn_read(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, + struct thread *td) { struct vnode *vp; - int error, ioflag; struct mtx *mtxp; - int vfslocked; + void *rl_cookie; + int ioflag; + int error; KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); - mtxp = NULL; - vp = fp->f_vnode; ioflag = 0; if (fp->f_flag & FNONBLOCK) ioflag |= IO_NDELAY; if (fp->f_flag & O_DIRECT) ioflag |= IO_DIRECT; - vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vp = fp->f_vnode; + /* * According to McKusick the vn lock was protecting f_offset here. * It is now protected by the FOFFSET_LOCKED flag. */ if ((flags & FOF_OFFSET) == 0) { - mtxp = mtx_pool_find(mtxpool_sleep, fp); - mtx_lock(mtxp); - while(fp->f_vnread_flags & FOFFSET_LOCKED) { - fp->f_vnread_flags |= FOFFSET_LOCK_WAITING; - msleep(&fp->f_vnread_flags, mtxp, PUSER -1, - "vnread offlock", 0); - } - fp->f_vnread_flags |= FOFFSET_LOCKED; - mtx_unlock(mtxp); - vn_lock(vp, LK_SHARED | LK_RETRY); + mtxp = vn_lock_foffset(fp); uio->uio_offset = fp->f_offset; } else - vn_lock(vp, LK_SHARED | LK_RETRY); - + mtxp = NULL; /* gcc */ + if (vp->v_type == VREG) + rl_cookie = rangelock_rlock(vp, uio->uio_offset, + uio->uio_resid); + else + rl_cookie = NULL; ioflag |= sequential_heuristic(uio, fp); - -#ifdef MAC - error = mac_vnode_check_read(active_cred, fp->f_cred, vp); - if (error == 0) -#endif - error = VOP_READ(vp, uio, ioflag, fp->f_cred); + error = vn_read_chunk(vp, uio, active_cred, fp->f_cred, ioflag); + fp->f_nextoff = uio->uio_offset; + if (rl_cookie != NULL) + rangelock_unlock(vp, rl_cookie); if ((flags & FOF_OFFSET) == 0) { fp->f_offset = uio->uio_offset; - mtx_lock(mtxp); - if (fp->f_vnread_flags & FOFFSET_LOCK_WAITING) - wakeup(&fp->f_vnread_flags); - fp->f_vnread_flags = 0; - mtx_unlock(mtxp); + vn_unlock_foffset(fp, mtxp); } - fp->f_nextoff = uio->uio_offset; - VOP_UNLOCK(vp, 0); - VFS_UNLOCK_GIANT(vfslocked); return (error); } -/* - * File table vnode write routine. - */ -static int -vn_write(fp, uio, active_cred, flags, td) - struct file *fp; - struct uio *uio; - struct ucred *active_cred; - struct thread *td; - int flags; +static inline int +vn_write_chunk(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, int ioflag, struct thread *td) { - struct vnode *vp; struct mount *mp; - int error, ioflag, lock_flags; - int vfslocked; + struct vnode *vp; + int error, lock_flags, vfslocked; - KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", - uio->uio_td, td)); + mp = NULL; vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); if (vp->v_type == VREG) bwillwrite(); - ioflag = IO_UNIT; - if (vp->v_type == VREG && (fp->f_flag & O_APPEND)) - ioflag |= IO_APPEND; - if (fp->f_flag & FNONBLOCK) - ioflag |= IO_NDELAY; - if (fp->f_flag & O_DIRECT) - ioflag |= IO_DIRECT; - if ((fp->f_flag & O_FSYNC) || - (vp->v_mount && (vp->v_mount->mnt_flag & MNT_SYNCHRONOUS))) - ioflag |= IO_SYNC; - mp = NULL; if (vp->v_type != VCHR && (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; if ((MNT_SHARED_WRITES(mp) || ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) && - (flags & FOF_OFFSET) != 0) { + (flags & FOF_OFFSET) != 0) lock_flags = LK_SHARED; - } else { + else lock_flags = LK_EXCLUSIVE; - } - vn_lock(vp, lock_flags | LK_RETRY); if ((flags & FOF_OFFSET) == 0) uio->uio_offset = fp->f_offset; ioflag |= sequential_heuristic(uio, fp); #ifdef MAC error = mac_vnode_check_write(active_cred, fp->f_cred, vp); - if (error == 0) +#else + error = 0; #endif - error = VOP_WRITE(vp, uio, ioflag, fp->f_cred); + if (error == 0) { + error = vnode_pager_write(vp, uio, ioflag); + if (error == EOPNOTSUPP) + error = VOP_WRITE(vp, uio, ioflag, fp->f_cred); + } if ((flags & FOF_OFFSET) == 0) fp->f_offset = uio->uio_offset; fp->f_nextoff = uio->uio_offset; @@ -625,6 +651,48 @@ unlock: } /* + * File table vnode write routine. + */ +static int +vn_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, + struct thread *td) +{ + struct vnode *vp; + void *rl_cookie; + int error, ioflag; + + KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", + uio->uio_td, td)); + vp = fp->f_vnode; + ioflag = IO_UNIT; + if (vp->v_type == VREG && (fp->f_flag & O_APPEND)) + ioflag |= IO_APPEND; + if (fp->f_flag & FNONBLOCK) + ioflag |= IO_NDELAY; + if (fp->f_flag & O_DIRECT) + ioflag |= IO_DIRECT; + if ((fp->f_flag & O_FSYNC) || + (vp->v_mount && (vp->v_mount->mnt_flag & MNT_SYNCHRONOUS))) + ioflag |= IO_SYNC; + if (vp->v_type == VREG) { + if ((ioflag & IO_APPEND) || !(flags & FOF_OFFSET)) + /* + * For appenders, punt and lock the whole + * range. It also protects f_offset. + */ + rl_cookie = rangelock_wlock(vp, 0, (size_t)-1); + else + rl_cookie = rangelock_wlock(vp, uio->uio_offset, + uio->uio_resid); + } else + rl_cookie = NULL; + error = vn_write_chunk(fp, uio, active_cred, flags, ioflag, td); + if (rl_cookie != NULL) + rangelock_unlock(vp, rl_cookie); + return (error); +} + +/* * File table truncate routine. */ static int diff --git a/sys/sys/rangelock.h b/sys/sys/rangelock.h new file mode 100644 index 0000000..5ec6433 --- /dev/null +++ b/sys/sys/rangelock.h @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2009 Konstantin Belousov + * All rights reserved. + * + * $FreeBSD$ + */ + +#ifndef _SYS_RANGELOCK_H +#define _SYS_RANGELOCK_H + +#include +#include +#include +#include +#include + +#ifdef _KERNEL + +struct vnode; + +struct rl_q_entry +{ + TAILQ_ENTRY(rl_q_entry) rl_q_link; + size_t rl_q_start, rl_q_end; + int rl_q_flags; +}; + +#define RL_LOCK_READ 0x0001 +#define RL_LOCK_WRITE 0x0002 +#define RL_LOCK_TYPE_MASK 0x0003 +#define RL_LOCK_GRANTED 0x0004 + +struct rangelock +{ + TAILQ_HEAD(, rl_q_entry) rl_waiters; + struct rl_q_entry *rl_currdep; +}; + +void rangelock_init(struct rangelock *lock); +void rangelock_destroy(struct rangelock *lock); +void rangelock_unlock(struct vnode *vp, void *cookie); +void *rangelock_unlock_range(struct vnode *vp, void *cookie, off_t base, + size_t len); +void *rangelock_rlock(struct vnode *vp, off_t base, size_t len); +void *rangelock_wlock(struct vnode *vp, off_t base, size_t len); +#endif + +#endif diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index b38c1d0..2e23522 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -168,7 +169,8 @@ struct vnode { */ struct vpollinfo *v_pollinfo; /* G Poll events, p for *v_pi */ struct label *v_label; /* MAC label for vnode */ - struct lockf *v_lockf; /* Byte-level lock list */ + struct lockf *v_lockf; /* Byte-level adv lock list */ + struct rangelock v_rl; /* Byte-range lock */ }; #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ @@ -655,6 +657,8 @@ int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, void *base, size_t len, off_t offset, enum uio_seg segflg, int ioflg, struct ucred *active_cred, struct ucred *file_cred, size_t *aresid, struct thread *td); +int vn_read_chunk(struct vnode *vp, struct uio *uio, + struct ucred *active_cred, struct ucred *f_cred, int ioflag); int vn_stat(struct vnode *vp, struct stat *sb, struct ucred *active_cred, struct ucred *file_cred, struct thread *td); int vn_start_write(struct vnode *vp, struct mount **mpp, int flags); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 464a761..4c173fe 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -463,7 +463,7 @@ ffs_read(ap) return error; } #endif - + KASSERT(uio->uio_segflg != UIO_USERSPACE, ("ffs_read: UIO_USERSPACE")); seqcount = ap->a_ioflag >> IO_SEQSHIFT; ip = VTOI(vp); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 08b77ae..8f537b3 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1900,7 +1900,8 @@ ufs_readdir(ap) uio->uio_iov->iov_len = count; # if (BYTE_ORDER == LITTLE_ENDIAN) if (ap->a_vp->v_mount->mnt_maxsymlinklen > 0) { - error = VOP_READ(ap->a_vp, uio, 0, ap->a_cred); + error = vn_read_chunk(ap->a_vp, uio, ap->a_cred, + ap->a_cred, IO_NODELOCKED); } else { struct dirent *dp, *edp; struct uio auio; @@ -1916,7 +1917,8 @@ ufs_readdir(ap) aiov.iov_len = count; dirbuf = malloc(count, M_TEMP, M_WAITOK); aiov.iov_base = dirbuf; - error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred); + error = vn_read_chunk(ap->a_vp, &auio, ap->a_cred, + ap->a_cred, IO_NODELOCKED); if (error == 0) { readcnt = count - auio.uio_resid; edp = (struct dirent *)&dirbuf[readcnt]; @@ -1938,7 +1940,8 @@ ufs_readdir(ap) free(dirbuf, M_TEMP); } # else - error = VOP_READ(ap->a_vp, uio, 0, ap->a_cred); + error = vn_read_chunk(ap->a_vp, uio, ap->a_cred, + ap->a_cred, IO_NODELOCKED); # endif if (!error && ap->a_ncookies != NULL) { struct dirent* dpStart; diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index ff48983..ccfd066 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -84,5 +84,8 @@ void vm_thread_dispose(struct thread *td); int vm_thread_new(struct thread *td, int pages); void vm_thread_swapin(struct thread *td); void vm_thread_swapout(struct thread *td); +int vnode_pager_read(struct vnode *vp, struct uio *uio, int ioflags); +int vnode_pager_write(struct vnode *vp, struct uio *uio, int ioflags); + #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */ diff --git a/sys/vm/vm_readwrite.c b/sys/vm/vm_readwrite.c new file mode 100644 index 0000000..12c4157 --- /dev/null +++ b/sys/vm/vm_readwrite.c @@ -0,0 +1,379 @@ +/*- + * Copyright (c) 2008 Jeffrey Roberson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* + * XXXKIB TODO + * + * 1. Backpressure for writes + * 2. VOP_REALLOCBLKS + * + */ + +/* + * Grab a page, waiting until we are woken up due to the page + * changing state. We keep on waiting, if the page continues + * to be in the object. If the page doesn't exist allocate it. + * + * This routine may block. + */ +static vm_page_t +vm_page_grab_next(vm_object_t object, vm_page_t prev, vm_pindex_t pindex) +{ + vm_page_t m; + + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + m = NULL; + if (prev) { + m = TAILQ_NEXT(prev, listq); + if (m && m->pindex != pindex) + m = NULL; + } + for (;;) { + if (m == NULL) + m = vm_page_lookup(object, pindex); + if (m != NULL) { + if (vm_page_sleep_if_busy(m, TRUE, "pgrnbwt") == 0) + break; + m = NULL; + continue; + } + m = vm_page_alloc(object, pindex, + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); + if (m != NULL) + break; + VM_OBJECT_UNLOCK(object); + VM_WAIT; + VM_OBJECT_LOCK(object); + } + return (m); +} + +/* + * Read a cluster starting at 'm'. + */ +static int +vnode_pager_read_cluster(struct vnode *vp, vm_page_t m, int maxrun) +{ + vm_page_t pa[MAXPHYS / PAGE_SIZE]; + vm_object_t obj; + vm_pindex_t idx; + daddr_t blkno; + int bsize; + int error; + int run; + int i; + + obj = vp->v_object; + idx = m->pindex; + bsize = vp->v_mount->mnt_stat.f_iosize; + VM_OBJECT_UNLOCK(obj); + error = VOP_BMAP(vp, IDX_TO_OFF(idx)/bsize, NULL, &blkno, NULL, &run); + VM_OBJECT_LOCK(obj); + run = MIN(run, maxrun); + if (error || run == 0 || blkno == -1) + return (vm_pager_get_pages(obj, &m, 1, 0)); + run = (run + 1) * bsize / PAGE_SIZE; + run = MIN(run, vp->v_mount->mnt_iosize_max / PAGE_SIZE); + pa[0] = m; + for (i = 1; i < run; i++) { + m = vm_page_grab_next(obj, m, idx + i); + if (m->valid) { + run = i; + break; + } + vm_page_busy(m); + pa[i] = m; + } + return (vm_pager_get_pages(obj, pa, run, 0)); +} + +int +vnode_pager_read(struct vnode *vp, struct uio *uio, int ioflags) +{ + vm_object_t obj; + vm_offset_t off; + vm_pindex_t idx; + vm_page_t m; + ssize_t size; + int error, vn_locked, obj_locked; + struct thread *td; + + if (ioflags & (IO_EXT|IO_DIRECT)) + return (EOPNOTSUPP); + ASSERT_VOP_LOCKED(vp, "vnode_pager_read"); + + /* + * We are not VOP, so shall explicitely check for doomed + * vnodes. + */ + if (vp->v_iflag & VI_DOOMED) + return (EBADF); + + /* + * Ignore non-regular files. + */ + if (vp->v_type != VREG) + return (EOPNOTSUPP); + + obj = vp->v_object; + if (obj == NULL) + return (EOPNOTSUPP); + error = 0; + m = NULL; + vn_locked = VOP_ISLOCKED(vp); + obj_locked = 0; + td = uio->uio_td; + /* XXXKIB This should be disallowed. */ + if (td == NULL) + td = curthread; + while (uio->uio_resid > 0) { + if (!obj_locked) { + VM_OBJECT_LOCK(obj); + obj_locked = 1; + } + size = obj->un_pager.vnp.vnp_size - uio->uio_offset; + if (size <= 0) + break; + idx = OFF_TO_IDX(uio->uio_offset); + off = uio->uio_offset - IDX_TO_OFF(idx); + size = MIN(MIN(PAGE_SIZE - off, uio->uio_resid), size); + m = vm_page_grab_next(obj, m, idx); + if (!vm_page_is_valid(m, off, size)) { + vm_page_busy(m); + /* + * Read page, honouring read-ahead settings + * for filedescriptor. + */ + error = vnode_pager_read_cluster(vp, m, + howmany((ioflags >> IO_SEQSHIFT), PAGE_SIZE)); + m = vm_page_lookup(obj, idx); + if (m == NULL) { + if (error == VM_PAGER_OK) + continue; + error = EIO; + break; + } + if (m->valid == 0 || error != VM_PAGER_OK) { + vm_page_lock_queues(); + vm_page_free(m); + vm_page_unlock_queues(); + error = EIO; + break; + } + vm_page_wakeup(m); + } + vm_object_pip_add(obj, 1); + vm_page_io_start(m); + VM_OBJECT_UNLOCK(obj); + VOP_UNLOCK(vp, 0); + + /* + * Access user map pages, vnode lock is + * dropped. Possible page fault is safe at this point. + * Vnode rangelock is held, protecting from parallel + * writers. + */ + error = uiomove_fromphys(&m, off, size, uio); + VM_OBJECT_LOCK(obj); + vm_page_io_finish(m); + vm_object_pip_wakeup(obj); + VM_OBJECT_UNLOCK(obj); + obj_locked = 0; + vn_lock(vp, vn_locked | LK_RETRY); + if (error != 0 || (vp->v_iflag & VI_DOOMED)) + break; + } + if (obj_locked) + VM_OBJECT_UNLOCK(obj); + if (error == 0) + vfs_mark_atime(vp, td->td_ucred); + + return (error); +} + +int +vnode_pager_write(struct vnode *vp, struct uio *uio, int ioflags) +{ + vm_object_t obj; + vm_offset_t off; + vm_pindex_t idx; + vm_page_t m; + struct vattr vattr; + ssize_t size, osize, osize1, resid, sresid; + int error, vn_locked, obj_locked, bits; + struct thread *td; + + if (ioflags & (IO_EXT|IO_INVAL|IO_DIRECT)) + return (EOPNOTSUPP); + ASSERT_VOP_LOCKED(vp, "vnode_pager_write"); + if (vp->v_iflag & VI_DOOMED) + return (EBADF); + if (vp->v_type != VREG) + return (EOPNOTSUPP); + obj = vp->v_object; + if (obj == NULL) + return (EOPNOTSUPP); + error = 0; + m = NULL; + vn_locked = VOP_ISLOCKED(vp); + obj_locked = 0; + if (ioflags & IO_APPEND) + uio->uio_offset = obj->un_pager.vnp.vnp_size; + td = uio->uio_td; + if (td == NULL) + td = curthread; + + /* + * Enforce the RLIMIT_FSIZE there too. + */ + if (vp->v_type == VREG) { + PROC_LOCK(td->td_proc); + if (uio->uio_offset + uio->uio_resid > + lim_cur(td->td_proc, RLIMIT_FSIZE)) { + psignal(td->td_proc, SIGXFSZ); + PROC_UNLOCK(td->td_proc); + return (EFBIG); + } + PROC_UNLOCK(td->td_proc); + } + osize = osize1 = obj->un_pager.vnp.vnp_size; + resid = uio->uio_resid; + VATTR_NULL(&vattr); + while (uio->uio_resid > 0) { + size = uio->uio_resid; + idx = OFF_TO_IDX(uio->uio_offset); + off = uio->uio_offset - IDX_TO_OFF(idx); + size = MIN(PAGE_SIZE - off, uio->uio_resid); + osize1 = obj->un_pager.vnp.vnp_size; + + /* + * Extend the file if writing past end. + */ + if (osize1 < uio->uio_offset + size) { + vattr.va_size = uio->uio_offset + size; + if (obj_locked) { + VM_OBJECT_UNLOCK(obj); + obj_locked = 0; + } + error = VOP_SETATTR(vp, &vattr, td->td_ucred); + if (error != 0) + break; + } + + if (!obj_locked) { + VM_OBJECT_LOCK(obj); + obj_locked = 1; + } + m = vm_page_grab_next(obj, m, idx); + bits = vm_page_bits(off, size); + + /* + * Do read if page is going to be only partially + * written. + */ + if ((m->valid & ~bits) != ~bits) { + vm_page_busy(m); + error = vnode_pager_read_cluster(vp, m, 1); + m = vm_page_lookup(obj, idx); + if (m == NULL) { + if (error == VM_PAGER_OK) + continue; + error = EIO; + break; + } + if (m->valid == 0 || error != VM_PAGER_OK) { + vm_page_lock_queues(); + vm_page_free(m); + vm_page_unlock_queues(); + error = EIO; + break; + } + vm_page_wakeup(m); + } + vm_object_pip_add(obj, 1); + vm_page_io_start(m); + VM_OBJECT_UNLOCK(obj); + VOP_UNLOCK(vp, 0); + sresid = uio->uio_resid; + error = uiomove_fromphys(&m, off, size, uio); + VM_OBJECT_LOCK(obj); + if (error == 0) { + /* + * Note that the page and object are dirty. + */ + vm_page_lock_queues(); + m->valid |= vm_page_bits(off, sresid - uio->uio_resid); + vm_page_dirty(m); + vm_page_unlock_queues(); + vm_object_set_writeable_dirty(obj); + } + vm_page_io_finish(m); + vm_object_pip_wakeup(obj); + if (error == 0 && (ioflags & IO_SYNC)) + vm_object_page_clean(obj, idx, idx + 1, ioflags); + VM_OBJECT_UNLOCK(obj); + obj_locked = 0; + vn_lock(vp, vn_locked | LK_RETRY); + if (error != 0 || (vp->v_iflag & VI_DOOMED)) + break; + } + if (obj_locked) + VM_OBJECT_UNLOCK(obj); + if (error == 0 && (ioflags & IO_SYNC)) + error = VOP_FSYNC(vp, MNT_WAIT, td); + if (error != 0) { + /* + * Roll back for error if atomic write was requested. + */ + vattr.va_size = (ioflags & IO_UNIT) ? osize : osize1; + VOP_SETATTR(vp, &vattr, td->td_ucred); + if (ioflags & IO_UNIT) { + uio->uio_offset -= resid - uio->uio_resid; + uio->uio_resid = resid; + } + } + + return (error); +} diff --git a/tools/regression/file/uio/uio.c b/tools/regression/file/uio/uio.c new file mode 100644 index 0000000..d857605 --- /dev/null +++ b/tools/regression/file/uio/uio.c @@ -0,0 +1,116 @@ +/*- + * Copyright (c) 2009 Konstantin Belousov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int chunk_cnt = 1024; +int chunk_size = 1024; + +int +main(int argc, char *argv[]) +{ + struct iovec *wiov, *riov; + char **wdata, **rdata; + int fd, i; + ssize_t io_error; + + if (argc < 2) { + fprintf(stderr, "Usage: uio file [chunk count [chunk size]]\n"); + return (2); + } + fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); + if (fd == -1) { + fprintf(stderr, "Failed to create %s: %s\n", + argv[1], strerror(errno)); + return (1); + } + + if (argc > 2) + chunk_cnt = atoi(argv[2]); + if (argc > 3) + chunk_size = atoi(argv[3]); + + wiov = calloc(chunk_cnt, sizeof(*wiov)); + wdata = calloc(chunk_cnt, sizeof(*wdata)); + + riov = calloc(chunk_cnt, sizeof(*riov)); + rdata = calloc(chunk_cnt, sizeof(*rdata)); + + for (i = 0; i < chunk_cnt; i++) { + rdata[i] = malloc(chunk_size); + riov[i].iov_base = rdata[i]; + riov[i].iov_len = chunk_size; + + wdata[i] = malloc(chunk_size); + memset(wdata[i], i, chunk_size); + wiov[i].iov_base = wdata[i]; + wiov[i].iov_len = chunk_size; + } + + io_error = writev(fd, wiov, chunk_cnt); + if (io_error == -1) { + fprintf(stderr, "write failed: %s\n", strerror(errno)); + return (1); + } else if (io_error != chunk_cnt * chunk_size) { + fprintf(stderr, "truncated write: %d %d\n", + io_error, chunk_cnt * chunk_size); + return (1); + } + + if (lseek(fd, 0, SEEK_SET) == -1) { + fprintf(stderr, "lseek failed: %s\n", strerror(errno)); + return (1); + } + + io_error = readv(fd, riov, chunk_cnt); + if (io_error == -1) { + fprintf(stderr, "read failed: %s\n", strerror(errno)); + return (1); + } else if (io_error != chunk_cnt * chunk_size) { + fprintf(stderr, "truncated read: %d %d\n", + io_error, chunk_cnt * chunk_size); + return (1); + } + + for (i = 0; i < chunk_cnt; i++) { + if (memcmp(rdata[i], wdata[i], chunk_size) != 0) { + fprintf(stderr, "chunk %d differs\n", i); + return (1); + } + } + + return (0); +} diff --git a/tools/regression/ufs/ba_clrbuf/ba_clrbuf.c b/tools/regression/ufs/ba_clrbuf/ba_clrbuf.c new file mode 100644 index 0000000..1b0acbe --- /dev/null +++ b/tools/regression/ufs/ba_clrbuf/ba_clrbuf.c @@ -0,0 +1,129 @@ +/*- + * Copyright (c) 2009 Konstantin Belousov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const int blks = 2; + +static void +flush_buffers(int fd) +{ + struct stat st; + char *addr; + int error; + + printf("Flushing buffers\n"); + error = fstat(fd, &st); + if (error == -1) + err(2, "stat"); + fsync(fd); + addr = mmap(NULL, st.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + if (addr == (char *)-1) + err(2, "mmap"); + error = msync(addr, st.st_size, MS_SYNC | MS_INVALIDATE); + if (error == -1) + err(2, "msync"); + munmap(addr, st.st_size); +} + +int +main(int argc, char *argv[]) +{ + struct statfs fst; + char *data, *vrfy; + size_t sz; + int fd, i, error, ret; + + if (argc < 2) + errx(2, "Usage: ba_clrbuf file"); + + fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); + if (fd == -1) + err(2, "Failed to create %s", argv[1]); + + if (fstatfs(fd, &fst) == -1) + err(2, "stat"); + + sz = fst.f_iosize * blks; + data = malloc(sz); + if (data == NULL) + err(2, "malloc"); + vrfy = malloc(sz); + if (vrfy == NULL) + err(2, "malloc"); + for (i = 0; i < (int)sz; i++) + data[i] = i; + error = write(fd, data, sz); + if (error == -1) + err(2, "write"); + else if (error != (int)sz) + errx(2, "Short write %d %d", error, sz); + + flush_buffers(fd); + + error = lseek(fd, 0, SEEK_SET); + if (error == -1) + err(2, "lseek 0"); + else if (error != 0) + errx(2, "lseek 0 returned %d", error); + error = write(fd, NULL, fst.f_iosize); + printf("faulty write, error %s\n", strerror(errno)); + + error = lseek(fd, 0, SEEK_SET); + if (error == -1) + err(2, "lseek 0/2"); + else if (error != 0) + errx(2, "lseek 0/2 returned %d", error); + error = read(fd, vrfy, sz); + if (error == -1) + err(2, "read"); + else if (error != (int)sz) + errx(2, "short read %d %d", error, sz); + + if (memcmp(data, vrfy, fst.f_iosize) != 0) { + printf("Zero block corrupted, byte at 0 is %x\n", + (unsigned char)vrfy[0]); + ret = 1; + } else { + printf("No corruption\n"); + ret = 0; + } + + return (ret); +}