GENERIC from Wed Nov 25 17:02:15 2009 +0200, vm6 ae6f05f, vmcore.379 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 r199787+ae6f05f: Wed Nov 25 17:36:14 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 (1799.99-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: # mount -t ufs -a # swapon -a swapon: adding /dev/ad4s1b as swap device swapon: adding /dev/ad4s2b as swap device # dumpon /dev/ad4s1b # cd /usr/src # uname -a FreeBSD 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r199787+ae6f05f: Wed Nov 25 17:36:14 CET 2009 pho@x4.osted.lan:/var/tmp/deviant2/sys/i386/compile/PHO i386 # sysctl vfs.vmio_enabled vfs.vmio_enabled: 1 # sysctl vfs.vmio_enabled=0 vfs.vmio_enabled: 1 -> 0 # time make installworld > /tmp/installworld panic: ffs_read: UIO_USERSPACE cpuid = 0 KDB: enter: panic [thread pid 30 tid 100076 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> set $lines 0 db> bt Tracing pid 30 tid 100076 td 0xc7841480 kdb_enter(c0c975ea,c0c975ea,c0cbf44e,f642dac4,0,...) at kdb_enter+0x3a panic(c0cbf44e,f642db20,c0cc0f99,0,f642dadc,...) at panic+0x136 ffs_read(f642db94,c0cd48ab,0,0,c78832c8,...) at ffs_read+0x51 VOP_READ_APV(c0da2c00,f642db94,c78832c8,224,0,...) at VOP_READ_APV+0xc5 vn_read_chunk(c78832c8,f642dc58,c7175100,c7175100,20000,...) at vn_read_chunk+0xfe vn_read(c7808ce8,f642dc58,c7175100,0,c7841480,...) at vn_read+0xd9 dofileread(f642dc58,ffffffff,ffffffff,0,c7808ce8,...) at dofileread+0x96 kern_readv(c7841480,3,f642dc58,f642dc78,1,...) at kern_readv+0x58 read(c7841480,f642dcf8,c,c0c7e744,c0d80ef4,...) at read+0x4f syscall(f642dd38) at syscall+0x2b4 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x280536d3, esp = 0xbfbfe4fc, ebp = 0xbfbfe5a8 --- db> show allpcpu Current CPU: 0 cpuid = 0 dynamic pcpu = 0x667400 curthread = 0xc7841480: pid 30 "time" curpcb = 0xf642dd90 fpcurthread = none idlethread = 0xc7179480: pid 11 "idle: cpu0" APIC ID = 0 currentldt = 0x50 spin locks held: cpuid = 1 dynamic pcpu = 0x6026400 curthread = 0xc71796c0: pid 11 "idle: cpu1" curpcb = 0xc6e0ad90 fpcurthread = none idlethread = 0xc71796c0: pid 11 "idle: cpu1" APIC ID = 1 currentldt = 0x50 spin locks held: cpuid = 2 dynamic pcpu = 0x6029400 curthread = 0xc7179900: pid 11 "idle: cpu2" curpcb = 0xc6e07d90 fpcurthread = none idlethread = 0xc7179900: pid 11 "idle: cpu2" APIC ID = 2 currentldt = 0x50 spin locks held: cpuid = 3 dynamic pcpu = 0x602c400 curthread = 0xc7179b40: pid 11 "idle: cpu3" curpcb = 0xc6e04d90 fpcurthread = none idlethread = 0xc7179b40: pid 11 "idle: cpu3" APIC ID = 3 currentldt = 0x50 spin locks held: db> show z alllocks Process 30 (time) thread 0xc7841480 (100076) shared lockmgr ufs (ufs) r = 0 (0xc7883320) locked @ kern/vfs_vnops.c:548 db> show lockedvnods Locked vnodes 0xc78832c8: tag ufs, type VREG usecount 1, writecount 0, refcount 2 mountedhere 0 flags () v_object 0xc7887a18 ref 0 pages 1 lock type ufs: SHARED (count 1) #0 0xc0874632 at __lockmgr_args+0x582 #1 0xc0acccf1 at ffs_lock+0xa1 #2 0xc0bde545 at VOP_LOCK1_APV+0xb5 #3 0xc092b8f8 at _vn_lock+0x78 #4 0xc092cba5 at vn_read_chunk+0x85 #5 0xc092cd69 at vn_read+0xd9 #6 0xc08d19b6 at dofileread+0x96 #7 0xc08d1ce8 at kern_readv+0x58 #8 0xc08d1dff at read+0x4f #9 0xc0bc5714 at syscall+0x2b4 #10 0xc0ba7b90 at Xint0x80_syscall+0x20 ino 4592643, on dev ad4s1d db> show mount 0xc77aab40 /dev/ad4s1a on / (ufs) 0xc77ab000 devfs on /dev (devfs) 0xc78625a0 /dev/ad4s1e on /tmp (ufs) 0xc78622d0 /dev/ad4s1f on /usr (ufs) 0xc7862000 /dev/ad4s1d on /var (ufs) More info: show mount db> ps pid ppid pgrp uid state wmesg wchan cmd 30 21 30 0 R+ CPU 0 time 21 1 21 0 Ss+ wait 0xc78007f8 sh 20 0 0 0 SL flowclea 0xc0f5f148 [flowcleaner] 19 0 0 0 SL sdflush 0xc0f6a880 [softdepflush] 18 0 0 0 SL vlruwt 0xc77837f8 [vnlru] 17 0 0 0 SL syncer 0xc0f5ef54 [syncer] 16 0 0 0 SL psleep 0xc0f5ec88 [bufdaemon] 15 0 0 0 SL pgzero 0xc0f6b698 [pagezero] 9 0 0 0 SL psleep 0xc0f6b2c4 [vmdaemon] 8 0 0 0 SL psleep 0xc0f6b28c [pagedaemon] 7 0 0 0 SL - 0xc73c023c [fdc0] 6 0 0 0 SL - 0xc73f4000 [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 0xc0dbe8d4 [xpt_thrd] 13 0 0 0 SL - 0xc0df2504 [yarrow] 4 0 0 0 SL - 0xc0df02e4 [g_down] 3 0 0 0 SL - 0xc0df02e0 [g_up] 2 0 0 0 SL - 0xc0df02d8 [g_event] 12 0 0 0 WL (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 I [swi4: clock] 100007 I [swi3: vm] 11 0 0 0 RL (threaded) [idle] 100006 CanRun [idle: cpu0] 100005 Run CPU 1 [idle: cpu1] 100004 Run CPU 2 [idle: cpu2] 100003 Run CPU 3 [idle: cpu3] 1 0 1 0 SLs wait 0xc7177d48 [init] 10 0 0 0 SL audit_wo 0xc0f6a1a0 [audit] 0 0 0 0 SLs (threaded) [kernel] 100061 D - 0xc73a1880 [fw0_taskq] 100026 D - 0xc734c0c0 [kqueue taskq] 100025 D - 0xc734c100 [acpi_task_2] 100024 D - 0xc734c100 [acpi_task_1] 100023 D - 0xc734c100 [acpi_task_0] 100018 D - 0xc734c540 [thread taskq] 100016 D - 0xc715ed80 [firmware taskq] 100000 D sched 0xc0df03a0 [swapper] db> allt Tracing command time pid 30 tid 100076 td 0xc7841480 kdb_enter(c0c975ea,c0c975ea,c0cbf44e,f642dac4,0,...) at kdb_enter+0x3a panic(c0cbf44e,f642db20,c0cc0f99,0,f642dadc,...) at panic+0x136 ffs_read(f642db94,c0cd48ab,0,0,c78832c8,...) at ffs_read+0x51 VOP_READ_APV(c0da2c00,f642db94,c78832c8,224,0,...) at VOP_READ_APV+0xc5 vn_read_chunk(c78832c8,f642dc58,c7175100,c7175100,20000,...) at vn_read_chunk+0xfe vn_read(c7808ce8,f642dc58,c7175100,0,c7841480,...) at vn_read+0xd9 dofileread(f642dc58,ffffffff,ffffffff,0,c7808ce8,...) at dofileread+0x96 kern_readv(c7841480,3,f642dc58,f642dc78,1,...) at kern_readv+0x58 read(c7841480,f642dcf8,c,c0c7e744,c0d80ef4,...) at read+0x4f syscall(f642dd38) at syscall+0x2b4 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (3, FreeBSD ELF32, read), eip = 0x280536d3, esp = 0xbfbfe4fc, ebp = 0xbfbfe5a8 --- Tracing command sh pid 21 tid 100075 td 0xc7805000 sched_switch(c7805000,0,104,191,8ee7e1b9,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,5c,...) at mi_switch+0x200 sleepq_switch(c7805000,0,c0c9ba53,18b,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0c9ba53,15b,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c78007f8,5c,c0c9e232,100,0,...) at sleepq_wait_sig+0x17 _sleep(c78007f8,c7800880,15c,c0c9e232,0,...) at _sleep+0x354 kern_wait(c7805000,ffffffff,f6429c74,2,0,...) at kern_wait+0xb76 wait4(c7805000,f6429cf8,10,c0c9e211,c0d80f64,...) at wait4+0x3b syscall(f6429d38) at syscall+0x2b4 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x2815dcdb, esp = 0xbfbfec4c, ebp = 0xbfbfec68 --- Tracing command flowcleaner pid 20 tid 100074 td 0xc74e76c0 sched_switch(c74e76c0,0,104,191,56210573,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c74e76c0,0,c0c9ba53,26e,c74e76c0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f5f148,0,f4239cc4,1,0,...) at sleepq_timedwait+0x6b _cv_timedwait(c0f5f148,c0f5f150,2710,3f0,0,...) at _cv_timedwait+0x250 flowtable_cleaner(0,f4239d38,c0c92a6a,343,c77832a8,...) at flowtable_cleaner+0x1bf fork_exit(c0935210,0,f4239d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4239d70, ebp = 0 --- Tracing command softdepflush pid 19 tid 100073 td 0xc74e7900 sched_switch(c74e7900,0,104,191,6ddd8ff1,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,44,...) at mi_switch+0x200 sleepq_switch(c74e7900,0,c0c9ba53,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f6a880,44,c0cbe855,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f6a880,c0f6a824,44,c0cbe855,3e8,...) at _sleep+0x339 softdep_flush(0,f4236d38,c0c92a6a,343,c7783550,...) at softdep_flush+0x244 fork_exit(c0ac2c80,0,f4236d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4236d70, ebp = 0 --- Tracing command vnlru pid 18 tid 100072 td 0xc74e7b40 sched_switch(c74e7b40,0,104,191,6ddd1833,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,50,...) at mi_switch+0x200 sleepq_switch(c74e7b40,0,c0c9ba53,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c77837f8,50,c0ca5a55,0,0,...) at sleepq_timedwait+0x6b _sleep(c77837f8,c0f5ef14,250,c0ca5a55,3e8,...) at _sleep+0x339 vnlru_proc(0,f4233d38,c0c92a6a,343,c77837f8,...) at vnlru_proc+0xe7 fork_exit(c09208a0,0,f4233d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4233d70, ebp = 0 --- Tracing command syncer pid 17 tid 100071 td 0xc74e7d80 sched_switch(c74e7d80,0,104,191,6dda3fe1,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c74e7d80,0,c0c9ba53,26e,c74e7d80,...) at sleepq_switch+0x15f sleepq_timedwait(c0f5ef54,0,f4230c88,1,0,...) at sleepq_timedwait+0x6b _cv_timedwait(c0f5ef54,c0f5ef40,3e8,6ce,4e20,...) at _cv_timedwait+0x250 sched_sync(0,f4230d38,c0c92a6a,343,c7783aa0,...) at sched_sync+0x502 fork_exit(c091fcd0,0,f4230d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4230d70, ebp = 0 --- Tracing command bufdaemon pid 16 tid 100070 td 0xc74e9000 sched_switch(c74e9000,0,104,191,6ddccef9,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,44,...) at mi_switch+0x200 sleepq_switch(c74e9000,0,c0c9ba53,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f5ec88,44,c0ca2fbf,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f5ec88,c0f5ec8c,44,c0ca2fbf,3e8,...) at _sleep+0x339 buf_daemon(0,f422dd38,c0c92a6a,343,c7783d48,...) at buf_daemon+0x138 fork_exit(c0907ed0,0,f422dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf422dd70, ebp = 0 --- Tracing command pagezero pid 15 tid 100069 td 0xc74e9240 sched_switch(c74e9240,0,104,191,397d7917,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c74e9240,0,c0c9ba53,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f6b698,0,c0cc46c5,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f6b698,c0f6b180,0,c0cc46c5,493e0,...) at _sleep+0x339 vm_pagezero(0,f422ad38,c0c92a6a,343,c71782a8,...) at vm_pagezero+0xdc fork_exit(c0b03af0,0,f422ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf422ad70, ebp = 0 --- Tracing command vmdaemon pid 9 tid 100068 td 0xc74e9480 sched_switch(c74e9480,0,104,191,3978839b,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,68,...) at mi_switch+0x200 sleepq_switch(c74e9480,0,c0c9ba53,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c0f6b2c4,68,c0ca2fbf,0,0,...) at sleepq_wait+0x63 _sleep(c0f6b2c4,c0f6b2c8,68,c0ca2fbf,0,...) at _sleep+0x36b vm_daemon(0,f4227d38,c0c92a6a,343,c7178550,...) at vm_daemon+0x59 fork_exit(c0afc780,0,f4227d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4227d70, ebp = 0 --- Tracing command pagedaemon pid 8 tid 100067 td 0xc74e96c0 sched_switch(c74e96c0,0,104,191,6ddc8ce8,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,44,...) at mi_switch+0x200 sleepq_switch(c74e96c0,0,c0c9ba53,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0f6b28c,44,c0ca2fbf,0,0,...) at sleepq_timedwait+0x6b _sleep(c0f6b28c,c0f6b180,44,c0ca2fbf,1388,...) at _sleep+0x339 vm_pageout(0,f4224d38,c0c92a6a,343,c71787f8,...) at vm_pageout+0x2bb fork_exit(c0afd630,0,f4224d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4224d70, ebp = 0 --- Tracing command fdc0 pid 7 tid 100064 td 0xc74e9d80 sched_switch(c74e9d80,0,104,191,719ddf11,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c74e9d80,0,c0c9ba53,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c73c023c,4c,c0c8d252,0,0,...) at sleepq_timedwait+0x6b _sleep(c73c023c,c73c02f0,4c,c0c8d252,3e8,...) at _sleep+0x339 fdc_thread(c73c0200,f41bbd38,c0c92a6a,343,c7178aa0,...) at fdc_thread+0x27d fork_exit(c0b81070,c73c0200,f41bbd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41bbd70, ebp = 0 --- Tracing command fw0_probe pid 6 tid 100062 td 0xc73ba480 sched_switch(c73ba480,0,104,191,3881a32e,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,5c,...) at mi_switch+0x200 sleepq_switch(c73ba480,0,c0c9ba53,18b,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0c9ba53,15b,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c73f4000,5c,c0c8d252,100,0,...) at sleepq_wait_sig+0x17 _sleep(c73f4000,c73f8488,15c,c0c8d252,0,...) at _sleep+0x354 fw_bus_probe_thread(c73f4000,f41abd38,c0c92a6a,343,c7178d48,...) at fw_bus_probe_thread+0xa08 fork_exit(c0659aa0,c73f4000,f41abd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41abd70, ebp = 0 --- Tracing command usb pid 14 tid 100058 td 0xc73bad80 sched_switch(c73bad80,0,104,191,1465402a,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73bad80,0,c0c9ba53,24b,c73bad80,...) at sleepq_switch+0x15f sleepq_wait(c73d4d0c,0,f4194cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73d4d0c,c73d4dac,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73d4d04,f4194d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73d4d04,f4194d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4194d70, ebp = 0 --- Tracing command usb pid 14 tid 100057 td 0xc73cc000 sched_switch(c73cc000,0,104,191,e5c7b313,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73cc000,0,c0c9ba53,24b,c73cc000,...) at sleepq_switch+0x15f sleepq_wait(c73d4cdc,0,f4191cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73d4cdc,c73d4dac,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73d4cd4,f4191d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73d4cd4,f4191d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4191d70, ebp = 0 --- Tracing command usb pid 14 tid 100056 td 0xc73cc240 sched_switch(c73cc240,0,104,191,13fea84c,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73cc240,0,c0c9ba53,24b,c73cc240,...) at sleepq_switch+0x15f sleepq_wait(c73d4cac,0,f418ecb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73d4cac,c73d4dac,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73d4ca4,f418ed38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73d4ca4,f418ed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf418ed70, ebp = 0 --- Tracing command usb pid 14 tid 100055 td 0xc73cc480 sched_switch(c73cc480,0,104,191,13fe97a2,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73cc480,0,c0c9ba53,24b,c73cc480,...) at sleepq_switch+0x15f sleepq_wait(c73d4c7c,0,f418bcb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73d4c7c,c73d4dac,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73d4c74,f418bd38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73d4c74,f418bd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf418bd70, ebp = 0 --- Tracing command usb pid 14 tid 100053 td 0xc73cc900 sched_switch(c73cc900,0,104,191,13fe828b,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73cc900,0,c0c9ba53,24b,c73cc900,...) at sleepq_switch+0x15f sleepq_wait(c73c6b5c,0,f4183cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c6b5c,c73c6bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73c6b54,f4183d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73c6b54,f4183d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4183d70, ebp = 0 --- Tracing command usb pid 14 tid 100052 td 0xc73ccb40 sched_switch(c73ccb40,0,104,191,8b2232a5,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73ccb40,0,c0c9ba53,24b,c73ccb40,...) at sleepq_switch+0x15f sleepq_wait(c73c6b2c,0,f4180cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c6b2c,c73c6bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73c6b24,f4180d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73c6b24,f4180d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4180d70, ebp = 0 --- Tracing command usb pid 14 tid 100051 td 0xc73ccd80 sched_switch(c73ccd80,0,104,191,139b4c56,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73ccd80,0,c0c9ba53,24b,c73ccd80,...) at sleepq_switch+0x15f sleepq_wait(c73c6afc,0,f417dcb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c6afc,c73c6bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73c6af4,f417dd38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73c6af4,f417dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf417dd70, ebp = 0 --- Tracing command usb pid 14 tid 100050 td 0xc736c6c0 sched_switch(c736c6c0,0,104,191,139b3bd4,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736c6c0,0,c0c9ba53,24b,c736c6c0,...) at sleepq_switch+0x15f sleepq_wait(c73c6acc,0,f417acb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c6acc,c73c6bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73c6ac4,f417ad38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73c6ac4,f417ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf417ad70, ebp = 0 --- Tracing command usb pid 14 tid 100049 td 0xc736c900 sched_switch(c736c900,0,104,191,139b2992,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736c900,0,c0c9ba53,24b,c736c900,...) at sleepq_switch+0x15f sleepq_wait(c73c2b5c,0,f4176cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c2b5c,c73c2bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73c2b54,f4176d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73c2b54,f4176d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4176d70, ebp = 0 --- Tracing command usb pid 14 tid 100048 td 0xc736cb40 sched_switch(c736cb40,0,104,191,8acfca11,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736cb40,0,c0c9ba53,24b,c736cb40,...) at sleepq_switch+0x15f sleepq_wait(c73c2b2c,0,f4173cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c2b2c,c73c2bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73c2b24,f4173d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73c2b24,f4173d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4173d70, ebp = 0 --- Tracing command usb pid 14 tid 100047 td 0xc736cd80 sched_switch(c736cd80,0,104,191,1337c301,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736cd80,0,c0c9ba53,24b,c736cd80,...) at sleepq_switch+0x15f sleepq_wait(c73c2afc,0,f4170cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c2afc,c73c2bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73c2af4,f4170d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73c2af4,f4170d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4170d70, ebp = 0 --- Tracing command usb pid 14 tid 100046 td 0xc73b9000 sched_switch(c73b9000,0,104,191,1337b238,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9000,0,c0c9ba53,24b,c73b9000,...) at sleepq_switch+0x15f sleepq_wait(c73c2acc,0,f416dcb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73c2acc,c73c2bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73c2ac4,f416dd38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73c2ac4,f416dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf416dd70, ebp = 0 --- Tracing command usb pid 14 tid 100045 td 0xc73b9240 sched_switch(c73b9240,0,104,191,1337a0d5,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9240,0,c0c9ba53,24b,c73b9240,...) at sleepq_switch+0x15f sleepq_wait(c73bbb5c,0,f4169cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73bbb5c,c73bbbfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73bbb54,f4169d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73bbb54,f4169d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4169d70, ebp = 0 --- Tracing command usb pid 14 tid 100044 td 0xc73b9480 sched_switch(c73b9480,0,104,191,8a7d76d6,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9480,0,c0c9ba53,24b,c73b9480,...) at sleepq_switch+0x15f sleepq_wait(c73bbb2c,0,f4166cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73bbb2c,c73bbbfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73bbb24,f4166d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73bbb24,f4166d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4166d70, ebp = 0 --- Tracing command usb pid 14 tid 100043 td 0xc73b96c0 sched_switch(c73b96c0,0,104,191,12d3ca22,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b96c0,0,c0c9ba53,24b,c73b96c0,...) at sleepq_switch+0x15f sleepq_wait(c73bbafc,0,f4163cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73bbafc,c73bbbfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73bbaf4,f4163d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73bbaf4,f4163d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4163d70, ebp = 0 --- Tracing command usb pid 14 tid 100042 td 0xc73b9900 sched_switch(c73b9900,0,104,191,12d3b9ff,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9900,0,c0c9ba53,24b,c73b9900,...) at sleepq_switch+0x15f sleepq_wait(c73bbacc,0,f4160cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73bbacc,c73bbbfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73bbac4,f4160d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73bbac4,f4160d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4160d70, ebp = 0 --- Tracing command usb pid 14 tid 100040 td 0xc73b9d80 sched_switch(c73b9d80,0,104,191,12d3a4ad,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73b9d80,0,c0c9ba53,24b,c73b9d80,...) at sleepq_switch+0x15f sleepq_wait(c73b6b5c,0,f4159cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73b6b5c,c73b6bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73b6b54,f4159d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73b6b54,f4159d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4159d70, ebp = 0 --- Tracing command usb pid 14 tid 100039 td 0xc73ba000 sched_switch(c73ba000,0,104,191,8a2af836,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73ba000,0,c0c9ba53,24b,c73ba000,...) at sleepq_switch+0x15f sleepq_wait(c73b6b2c,0,f4156cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73b6b2c,c73b6bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73b6b24,f4156d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73b6b24,f4156d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4156d70, ebp = 0 --- Tracing command usb pid 14 tid 100038 td 0xc7350d80 sched_switch(c7350d80,0,104,191,12702df6,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c7350d80,0,c0c9ba53,24b,c7350d80,...) at sleepq_switch+0x15f sleepq_wait(c73b6afc,0,f4153cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73b6afc,c73b6bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73b6af4,f4153d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73b6af4,f4153d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4153d70, ebp = 0 --- Tracing command usb pid 14 tid 100037 td 0xc736a000 sched_switch(c736a000,0,104,191,12701c5e,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736a000,0,c0c9ba53,24b,c736a000,...) at sleepq_switch+0x15f sleepq_wait(c73b6acc,0,f4150cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73b6acc,c73b6bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73b6ac4,f4150d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73b6ac4,f4150d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4150d70, ebp = 0 --- Tracing command usb pid 14 tid 100035 td 0xc736a480 sched_switch(c736a480,0,104,191,127005c0,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736a480,0,c0c9ba53,24b,c736a480,...) at sleepq_switch+0x15f sleepq_wait(c73a7b5c,0,f4149cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73a7b5c,c73a7bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73a7b54,f4149d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73a7b54,f4149d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4149d70, ebp = 0 --- Tracing command usb pid 14 tid 100034 td 0xc736a6c0 sched_switch(c736a6c0,0,104,191,89f41f75,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736a6c0,0,c0c9ba53,24b,c736a6c0,...) at sleepq_switch+0x15f sleepq_wait(c73a7b2c,0,f4146cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73a7b2c,c73a7bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73a7b24,f4146d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73a7b24,f4146d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4146d70, ebp = 0 --- Tracing command usb pid 14 tid 100033 td 0xc736a900 sched_switch(c736a900,0,104,191,12064fad,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736a900,0,c0c9ba53,24b,c736a900,...) at sleepq_switch+0x15f sleepq_wait(c73a7afc,0,f4143cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73a7afc,c73a7bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73a7af4,f4143d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73a7af4,f4143d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4143d70, ebp = 0 --- Tracing command usb pid 14 tid 100032 td 0xc736ab40 sched_switch(c736ab40,0,104,191,12063d3f,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c736ab40,0,c0c9ba53,24b,c736ab40,...) at sleepq_switch+0x15f sleepq_wait(c73a7acc,0,f4140cb8,1,0,...) at sleepq_wait+0x63 _cv_wait(c73a7acc,c73a7bfc,c0c85fd2,6c,c0df6400,...) at _cv_wait+0x240 usb_process(c73a7ac4,f4140d38,c0c92a6a,343,c734e000,...) at usb_process+0x193 fork_exit(c07be310,c73a7ac4,f4140d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf4140d70, ebp = 0 --- Tracing command xpt_thrd pid 5 tid 100021 td 0xc7350480 sched_switch(c7350480,0,104,191,1206247e,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c7350480,0,c0c9ba53,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c0dbe8d4,4c,c0c31ada,0,0,...) at sleepq_wait+0x63 _sleep(c0dbe8d4,c0dbe8ec,4c,c0c31ada,0,...) at _sleep+0x36b xpt_scanner_thread(0,c6e3bd38,c0c92a6a,343,c734e2a8,...) at xpt_scanner_thread+0x4a fork_exit(c04841d0,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 0xc717b240 sched_switch(c717b240,0,104,191,8ec86e2b,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c717b240,0,c0c9ba53,26e,2,...) at sleepq_switch+0x15f sleepq_timedwait(c0df2504,0,c0c8d252,2,0,...) at sleepq_timedwait+0x6b _sleep(c0df2504,0,0,c0c8d252,64,...) at _sleep+0x339 pause(c0c8d252,64,c0c79d60,111,0,...) at pause+0x47 random_kthread(0,c6e2fd38,c0c92a6a,343,c734e550,...) at random_kthread+0x1ef fork_exit(c07361c0,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 0xc717b6c0 sched_switch(c717b6c0,0,104,191,917caa2f,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c717b6c0,0,c0c9ba53,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c0df02e4,4c,c0c8d252,0,0,...) at sleepq_wait+0x63 _sleep(c0df02e4,c0df0248,24c,c0c8d252,0,...) at _sleep+0x36b g_io_schedule_down(c717b6c0,0,c0c8e91a,74,0,...) at g_io_schedule_down+0x56 g_down_procbody(0,c6e29d38,c0c92a6a,343,c7177000,...) at g_down_procbody+0x8d fork_exit(c0828dd0,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 0xc717b900 sched_switch(c717b900,0,104,191,918a0362,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c717b900,0,c0c9ba53,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c0df02e0,4c,c0c8d252,0,0,...) at sleepq_wait+0x63 _sleep(c0df02e0,c0df0268,24c,c0c8d252,0,...) at _sleep+0x36b g_io_schedule_up(c717b900,0,c0c8e91a,5d,0,...) at g_io_schedule_up+0x11e g_up_procbody(0,c6e26d38,c0c92a6a,343,c71772a8,...) at g_up_procbody+0x8d fork_exit(c0828e60,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 0xc717bb40 sched_switch(c717bb40,0,104,191,88c8c61e,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,4c,...) at mi_switch+0x200 sleepq_switch(c717bb40,0,c0c9ba53,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0df02d8,4c,c0c8d252,0,0,...) at sleepq_timedwait+0x6b _sleep(c0df02d8,0,4c,c0c8d252,64,...) at _sleep+0x339 g_event_procbody(0,c6e23d38,c0c92a6a,343,c7177550,...) at g_event_procbody+0xcb fork_exit(c0828ef0,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 0xc74e9900 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100065 td 0xc74e9b40 sched_switch(c74e9b40,0,109,191,1201d74c,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c7175070,...) at mi_switch+0x200 ithread_loop(c74e0390,f41bed38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,c74e0390,f41bed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41bed70, ebp = 0 --- Tracing command intr pid 12 tid 100063 td 0xc73ba240 sched_switch(c73ba240,0,109,191,8edd158f,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c74db1f0,...) at mi_switch+0x200 ithread_loop(c74e0410,f41aed38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,c74e0410,f41aed38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41aed70, ebp = 0 --- Tracing command intr pid 12 tid 100060 td 0xc73ba900 sched_switch(c73ba900,0,109,191,11c534cd,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71be0f0,...) at mi_switch+0x200 ithread_loop(c73ebc00,f41a2d38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,c73ebc00,f41a2d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41a2d70, ebp = 0 --- Tracing command intr pid 12 tid 100059 td 0xc73bab40 sched_switch(c73bab40,0,109,191,1eb9dd34,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71be3f0,...) at mi_switch+0x200 ithread_loop(c73eb460,f419ad38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,c73eb460,f419ad38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf419ad70, ebp = 0 --- Tracing command intr pid 12 tid 100054 td 0xc73cc6c0 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100041 td 0xc73b9b40 sched_switch(c73b9b40,0,109,191,3c724bc1,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71be1f0,...) at mi_switch+0x200 ithread_loop(c739f640,f415dd38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,c739f640,f415dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf415dd70, ebp = 0 --- Tracing command intr pid 12 tid 100036 td 0xc736a240 sched_switch(c736a240,0,109,191,3bbf86e0,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71be270,...) at mi_switch+0x200 ithread_loop(c739f9d0,f414dd38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,c739f9d0,f414dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf414dd70, ebp = 0 --- Tracing command intr pid 12 tid 100031 td 0xc736ad80 sched_switch(c736ad80,0,109,191,3a82c34e,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71be2f0,...) at mi_switch+0x200 ithread_loop(c73ad120,f413dd38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,c73ad120,f413dd38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf413dd70, ebp = 0 --- Tracing command intr pid 12 tid 100030 td 0xc736c000 sched_switch(c736c000,0,109,191,91890e1b,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71bdef0,...) at mi_switch+0x200 ithread_loop(c739f510,c6f87d38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,c739f510,c6f87d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6f87d70, ebp = 0 --- Tracing command intr pid 12 tid 100029 td 0xc736c240 sched_switch(c736c240,0,109,191,2a5920cd,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c738c0f0,...) at mi_switch+0x200 ithread_loop(c73918e0,c6e81d38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,c73918e0,c6e81d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xc6e81d70, ebp = 0 --- Tracing command intr pid 12 tid 100028 td 0xc736c480 sched_switch(c736c480,0,109,191,12027528,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c7174b70,...) at mi_switch+0x200 ithread_loop(c7176610,c6e77d38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,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 0xc71bf6c0 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100022 td 0xc7350240 sched_switch(c7350240,0,109,191,3804cb94,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c73518f0,...) at mi_switch+0x200 ithread_loop(c7176390,c6e3ed38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,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 0xc73506c0 sched_switch(c73506c0,0,109,191,299a80c0,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c7351a70,...) at mi_switch+0x200 ithread_loop(c710ca30,c6e38d38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,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 0xc7350900 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100012 td 0xc717bd80 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100011 td 0xc71bf000 sched_switch(c71bf000,0,109,191,719de6c0,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71bdbf0,...) at mi_switch+0x200 ithread_loop(c71761d0,c6e1dd38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,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 0xc71bf240 sched_switch(c71bf240,0,109,191,e953bf77,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71bdc70,...) at mi_switch+0x200 ithread_loop(c71761e0,c6e1ad38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,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 0xc71bf480 sched_switch(c71bf480,0,109,191,88c8c3a4,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71bdcf0,...) at mi_switch+0x200 ithread_loop(c71761f0,c6e17d38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,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 sched_switch(c7179000,0,109,191,915b0768,...) at sched_switch+0x406 mi_switch(109,0,c0c92ce9,52d,c71bdd70,...) at mi_switch+0x200 ithread_loop(c7176200,c6e14d38,c0c92a6a,343,c71777f8,...) at ithread_loop+0x1f6 fork_exit(c0865070,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 0xc7179240 fork_trampoline() at fork_trampoline Tracing command idle pid 11 tid 100006 td 0xc7179480 sched_switch(c7179480,0,60c,18c,9189fd89,...) at sched_switch+0x406 mi_switch(60c,0,c0c99180,815,0,...) at mi_switch+0x200 sched_preempt(c7179480,0,1f4,c6e0dc6c,c0ba821e,...) at sched_preempt+0x9f ipi_bitmap_handler(8,28,28,c73c0e18,c73c0e00,...) at ipi_bitmap_handler+0x34 Xipi_intr_bitmap_handler() at Xipi_intr_bitmap_handler+0x2e --- interrupt, eip = 0xc0b9c315, esp = 0xc6e0dc6c, ebp = 0xc6e0dc6c --- acpi_cpu_c1(0,c6e0dcd4,0,ffffffff,c6e0dcb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(ffffffff,0,c6e0dcb4,c0bb3a6b,1,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(1,c6e0dcf8,c08af05e,1,c6e0dcd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(1,c6e0dcd4,c0c99180,a09,c7179480,...) at cpu_idle+0x1b sched_idletd(0,c6e0dd38,c0c92a6a,343,c7177aa0,...) at sched_idletd+0x23e fork_exit(c08aee20,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 0xc71796c0 cpustop_handler(2,c6e0ac70,c0bc5996,4,c6e0ac08,...) at cpustop_handler+0x32 ipi_nmi_handler(4,c6e0ac08,c0bacd99,c7174d80,c7177aa0,...) at ipi_nmi_handler+0x2f trap(c6e0ac7c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc08af03f, esp = 0xc6e0acbc, ebp = 0xc6e0acf8 --- sched_idletd(0,c6e0ad38,c0c92a6a,343,c7177aa0,...) at sched_idletd+0x21f fork_exit(c08aee20,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 0xc7179900 cpustop_handler(4,c6e07c20,c0bc5996,c6e07bb0,c087bea4,...) at cpustop_handler+0x32 ipi_nmi_handler(c6e07bb0,c087bea4,c0df2750,4,c7177aa0,...) at ipi_nmi_handler+0x2f trap(c6e07c2c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc0b9c315, esp = 0xc6e07c6c, ebp = 0xc6e07c6c --- acpi_cpu_c1(2,c6e07cd4,2,ffffffff,c6e07cb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(ffffffff,0,c6e07cb4,c0bb3a6b,1,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(1,c6e07cf8,c08af05e,1,c6e07cd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(1,c6e07cd4,c0c99180,a09,c7179900,...) at cpu_idle+0x1b sched_idletd(0,c6e07d38,c0c92a6a,343,c7177aa0,...) at sched_idletd+0x23e fork_exit(c08aee20,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 0xc7179b40 cpustop_handler(8,c6e04c20,c0bc5996,c6e04bb0,c087bea4,...) at cpustop_handler+0x32 ipi_nmi_handler(c6e04bb0,c087bea4,c0df2788,4,c7177aa0,...) at ipi_nmi_handler+0x2f trap(c6e04c2c) at trap+0x36 calltrap() at calltrap+0x6 --- trap 0x13, eip = 0xc0b9c315, esp = 0xc6e04c6c, ebp = 0xc6e04c6c --- acpi_cpu_c1(3,c6e04cd4,3,ffffffff,c6e04cb4,...) at acpi_cpu_c1+0x5 acpi_cpu_idle(ffffffff,0,c6e04cb4,c0bb3a6b,1,...) at acpi_cpu_idle+0x11c cpu_idle_amdc1e(1,c6e04cf8,c08af05e,1,c6e04cd4,...) at cpu_idle_amdc1e+0x56 cpu_idle(1,c6e04cd4,c0c99180,a09,c7179b40,...) at cpu_idle+0x1b sched_idletd(0,c6e04d38,c0c92a6a,343,c7177aa0,...) at sched_idletd+0x23e fork_exit(c08aee20,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 0xc7179d80 sched_switch(c7179d80,0,104,191,44e43b69,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,5c,...) at mi_switch+0x200 sleepq_switch(c7179d80,0,c0c9ba53,18b,5c,...) at sleepq_switch+0x15f sleepq_catch_signals(c0c9ba53,15b,0,100,100,...) at sleepq_catch_signals+0xb7 sleepq_wait_sig(c7177d48,5c,c0c9e232,100,0,...) at sleepq_wait_sig+0x17 _sleep(c7177d48,c7177dd0,15c,c0c9e232,0,...) at _sleep+0x354 kern_wait(c7179d80,ffffffff,c6e00c74,2,0,...) at kern_wait+0xb76 wait4(c7179d80,c6e00cf8,10,c7179d80,c0d80f64,...) at wait4+0x3b syscall(c6e00d38) at syscall+0x2b4 Xint0x80_syscall() at Xint0x80_syscall+0x20 --- syscall (7, FreeBSD ELF32, wait4), eip = 0x8054b8f, esp = 0xbfbfe86c, ebp = 0xbfbfe888 --- Tracing command audit pid 10 tid 100001 td 0xc717b000 sched_switch(c717b000,0,104,191,1203cad6,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c717b000,0,c0c9ba53,24b,c717b000,...) at sleepq_switch+0x15f sleepq_wait(c0f6a1a0,0,c6dfdc9c,1,0,...) at sleepq_wait+0x63 _cv_wait(c0f6a1a0,c0f6a184,c0cbbad7,194,0,...) at _cv_wait+0x240 audit_worker(0,c6dfdd38,c0c92a6a,343,c7178000,...) at audit_worker+0x84 fork_exit(c0a92090,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 0xc73ba6c0 sched_switch(c73ba6c0,0,104,191,8ec7fb4c,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c73ba6c0,0,c0c9ba53,24b,c73ba6c0,...) at sleepq_switch+0x15f sleepq_wait(c73a1880,0,c0c981ec,c0c8d252,0,...) at sleepq_wait+0x63 msleep_spin(c73a1880,c73a1898,c0c8d252,0,c0c95d21,...) at msleep_spin+0x21d taskqueue_thread_loop(c73f849c,f41a8d38,c0c92a6a,343,c0df03a0,...) at taskqueue_thread_loop+0x94 fork_exit(c08c8240,c73f849c,f41a8d38) at fork_exit+0xb8 fork_trampoline() at fork_trampoline+0x8 --- trap 0, eip = 0, esp = 0xf41a8d70, ebp = 0 --- Tracing command kernel pid 0 tid 100026 td 0xc71bf900 sched_switch(c71bf900,0,104,191,1475d272,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c71bf900,0,c0c9ba53,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c734c0c0,0,c0c8d252,0,0,...) at sleepq_wait+0x63 _sleep(c734c0c0,c734c0d8,0,c0c8d252,0,...) at _sleep+0x36b taskqueue_thread_loop(c0df0c30,c6e4ad38,c0c92a6a,343,c0df03a0,...) at taskqueue_thread_loop+0xba fork_exit(c08c8240,c0df0c30,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 0xc71bfb40 sched_switch(c71bfb40,0,104,191,1475be98,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c71bfb40,0,c0c9ba53,24b,c71bfb40,...) at sleepq_switch+0x15f sleepq_wait(c734c100,0,c0c981ec,c0c8d252,0,...) at sleepq_wait+0x63 msleep_spin(c734c100,c734c118,c0c8d252,0,c0c95d21,...) at msleep_spin+0x21d taskqueue_thread_loop(c0dc1720,c6e47d38,c0c92a6a,343,c0df03a0,...) at taskqueue_thread_loop+0x94 fork_exit(c08c8240,c0dc1720,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 0xc71bfd80 sched_switch(c71bfd80,0,104,191,1475ae68,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c71bfd80,0,c0c9ba53,24b,c71bfd80,...) at sleepq_switch+0x15f sleepq_wait(c734c100,0,c0c981ec,c0c8d252,0,...) at sleepq_wait+0x63 msleep_spin(c734c100,c734c118,c0c8d252,0,c0c95d21,...) at msleep_spin+0x21d taskqueue_thread_loop(c0dc1720,c6e44d38,c0c92a6a,343,c0df03a0,...) at taskqueue_thread_loop+0x94 fork_exit(c08c8240,c0dc1720,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,14759d09,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c7350000,0,c0c9ba53,24b,c7350000,...) at sleepq_switch+0x15f sleepq_wait(c734c100,0,c0c981ec,c0c8d252,0,...) at sleepq_wait+0x63 msleep_spin(c734c100,c734c118,c0c8d252,0,c0c95d21,...) at msleep_spin+0x21d taskqueue_thread_loop(c0dc1720,c6e41d38,c0c92a6a,343,c0df03a0,...) at taskqueue_thread_loop+0x94 fork_exit(c08c8240,c0dc1720,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 0xc7350b40 sched_switch(c7350b40,0,104,191,380703ea,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c7350b40,0,c0c9ba53,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c734c540,0,c0c8d252,0,0,...) at sleepq_wait+0x63 _sleep(c734c540,c734c558,0,c0c8d252,0,...) at _sleep+0x36b taskqueue_thread_loop(c0e04e88,c6e32d38,c0c92a6a,343,c0df03a0,...) at taskqueue_thread_loop+0xba fork_exit(c08c8240,c0e04e88,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 0xc717b480 sched_switch(c717b480,0,104,191,3cb365b8,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,0,...) at mi_switch+0x200 sleepq_switch(c717b480,0,c0c9ba53,24b,0,...) at sleepq_switch+0x15f sleepq_wait(c715ed80,0,c0c8d252,0,0,...) at sleepq_wait+0x63 _sleep(c715ed80,c715ed98,0,c0c8d252,0,...) at _sleep+0x36b taskqueue_thread_loop(c0e03920,c6e2cd38,c0c92a6a,343,c0df03a0,...) at taskqueue_thread_loop+0xba fork_exit(c08c8240,c0e03920,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 0xc0df0650 sched_switch(c0df0650,0,104,191,55768f22,...) at sched_switch+0x406 mi_switch(104,0,c0c9ba53,1d6,44,...) at mi_switch+0x200 sleepq_switch(c0df0650,0,c0c9ba53,26e,0,...) at sleepq_switch+0x15f sleepq_timedwait(c0df03a0,44,c0c999f5,0,0,...) at sleepq_timedwait+0x6b _sleep(c0df03a0,0,44,c0c999f5,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 99 MB: 84 68 52 36 20 4 Dump complete = 0xf db> reset (kgdb) bt #0 doadump () at pcpu.h:246 #1 0xc04cf999 in db_fncall (dummy1=0x1, dummy2=0x0, dummy3=0xc0fbefe0, dummy4=0xf642d89c "") at ../../../ddb/db_command.c:548 #2 0xc04cfd91 in db_command (last_cmdp=0xc0dbf8fc, cmd_table=0x0, dopager=0x1) at ../../../ddb/db_command.c:445 #3 0xc04cfeea in db_command_loop () at ../../../ddb/db_command.c:498 #4 0xc04d1d8d in db_trap (type=0x3, code=0x0) at ../../../ddb/db_main.c:229 #5 0xc08bb986 in kdb_trap (type=0x3, code=0x0, tf=0xf642da44) at ../../../kern/subr_kdb.c:535 #6 0xc0bc5f8b in trap (frame=0xf642da44) at ../../../i386/i386/trap.c:690 #7 0xc0ba7b2b in calltrap () at ../../../i386/i386/exception.s:165 #8 0xc08bbb0a in kdb_enter (why=0xc0c975ea "panic", msg=0xc0c975ea "panic") at cpufunc.h:71 #9 0xc088c1b6 in panic (fmt=0xc0cbf44e "ffs_read: UIO_USERSPACE") at ../../../kern/kern_shutdown.c:562 #10 0xc0acc131 in ffs_read (ap=0xf642db94) at ../../../ufs/ffs/ffs_vnops.c:466 #11 0xc0bdc3e5 in VOP_READ_APV (vop=0xc0da2c00, a=0xf642db94) at vnode_if.c:887 #12 0xc092cc1e in vn_read_chunk (vp=0xc78832c8, uio=0xf642dc58, active_cred=0xc7175100, fcred=0xc7175100, ioflag=0x20000) at vnode_if.h:384 #13 0xc092cd69 in vn_read (fp=0xc7808ce8, uio=0xf642dc58, active_cred=0xc7175100, flags=0x0, td=0xc7841480) at ../../../kern/vfs_vnops.c:604 #14 0xc08d19b6 in dofileread (td=0xc7841480, fd=0x3, fp=0xc7808ce8, auio=0xf642dc58, offset=0xffffffffffffffff, flags=0x0) at file.h:229 #15 0xc08d1ce8 in kern_readv (td=0xc7841480, fd=0x3, auio=0xf642dc58) at ../../../kern/sys_generic.c:237 #16 0xc08d1dff in read (td=0xc7841480, uap=0xf642dcf8) at ../../../kern/sys_generic.c:153 #17 0xc0bc5714 in syscall (frame=0xf642dd38) at ../../../i386/i386/trap.c:1078 #18 0xc0ba7b90 in Xint0x80_syscall () at ../../../i386/i386/exception.s:261 #19 0x00000033 in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) f 10 #10 0xc0acc131 in ffs_read (ap=0xf642db94) at ../../../ufs/ffs/ffs_vnops.c:466 466 KASSERT(vp->v_type != VREG || (vp->v_type == VREG && (kgdb) l 461 error = ffs_rawread(vp, uio, &workdone); 462 if (error != 0 || workdone != 0) 463 return error; 464 } 465 #endif 466 KASSERT(vp->v_type != VREG || (vp->v_type == VREG && 467 uio->uio_segflg != UIO_USERSPACE), ("ffs_read: UIO_USERSPACE")); 468 seqcount = ap->a_ioflag >> IO_SEQSHIFT; 469 ip = VTOI(vp); 470 (kgdb) p *vp $1 = {v_type = VREG, v_tag = 0xc0c901e2 "ufs", v_op = 0xc0da2c00, v_data = 0xc78813a0, v_mount = 0xc7862000, v_nmntvnodes = {tqe_next = 0x0, tqe_prev = 0xc7883440}, v_un = {vu_mount = 0x0, vu_socket = 0x0, vu_cdev = 0x0, vu_fifoinfo = 0x0, vu_yield = 0x0}, v_hashlist = {le_next = 0x0, le_prev = 0xc7524214}, v_hash = 0x461403, v_cache_src = {lh_first = 0x0}, v_cache_dst = {tqh_first = 0xc7886240, tqh_last = 0xc7886250}, v_cache_dd = 0x0, v_cstart = 0x0, v_lasta = 0x0, v_lastw = 0x0, v_clen = 0x0, v_lock = {lock_object = {lo_name = 0xc0c901e2 "ufs", lo_flags = 0x57b0000, lo_data = 0x0, lo_witness = 0xc7131910}, lk_lock = 0x11, lk_timo = 0x33, lk_pri = 0x50, lk_stack = {depth = 0xb, pcs = {0xc0874632, 0xc0acccf1, 0xc0bde545, 0xc092b8f8, 0xc092cba5, 0xc092cd69, 0xc08d19b6, 0xc08d1ce8, 0xc08d1dff, 0xc0bc5714, 0xc0ba7b90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}}, v_interlock = {lock_object = {lo_name = 0xc0c9daba "vnode interlock", lo_flags = 0x1030000, lo_data = 0x0, lo_witness = 0xc712b248}, mtx_lock = 0x4}, v_vnlock = 0xc7883320, v_holdcnt = 0x2, v_usecount = 0x1, v_iflag = 0x0, v_vflag = 0x0, v_writecount = 0x0, v_freelist = {tqe_next = 0x0, tqe_prev = 0x0}, v_bufobj = {bo_mtx = {lock_object = {lo_name = 0xc0ca5a2a "bufobj interlock", lo_flags = 0x1030000, lo_data = 0x0, lo_witness = 0xc71301e8}, mtx_lock = 0x4}, bo_clean = {bv_hd = {tqh_first = 0x0, tqh_last = 0xc78833d0}, bv_root = 0x0, bv_cnt = 0x0}, bo_dirty = {bv_hd = {tqh_first = 0x0, tqh_last = 0xc78833e0}, bv_root = 0x0, bv_cnt = 0x0}, bo_numoutput = 0x0, bo_flag = 0x0, bo_ops = 0xc0d916e0, bo_bsize = 0x4000, bo_object = 0xc7887a18, bo_synclist = { le_next = 0x0, le_prev = 0x0}, bo_private = 0xc78832c8, __bo_vnode = 0xc78832c8}, v_pollinfo = 0x0, v_label = 0x0, v_lockf = 0x0, v_rl = {rl_waiters = {tqh_first = 0xc79b230c, tqh_last = 0xc79b230c}, rl_currdep = 0x0}} (kgdb) p *uio $2 = {uio_iov = 0xf642dc78, uio_iovcnt = 0x1, uio_offset = 0x0, uio_resid = 0x80, uio_segflg = UIO_USERSPACE, uio_rw = UIO_READ, uio_td = 0xc7841480} (kgdb) git diff master diff --git a/sys/conf/files b/sys/conf/files index 1d014b9..c845b09 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2010,6 +2010,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 @@ -2697,6 +2698,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..6002ad3 --- /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_cluster.c b/sys/kern/vfs_cluster.c index 1ab263c..52cc37b 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -71,8 +71,8 @@ static int write_behind = 1; SYSCTL_INT(_vfs, OID_AUTO, write_behind, CTLFLAG_RW, &write_behind, 0, "Cluster write-behind; 0: disable, 1: enable, 2: backed off"); -static int read_max = 8; -SYSCTL_INT(_vfs, OID_AUTO, read_max, CTLFLAG_RW, &read_max, 0, +int vfs_read_max = 8; +SYSCTL_INT(_vfs, OID_AUTO, read_max, CTLFLAG_RW, &vfs_read_max, 0, "Cluster read-ahead max block count"); /* Page expended to mark partially backed buffers */ @@ -109,7 +109,7 @@ cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp) */ racluster = vp->v_mount->mnt_iosize_max / size; maxra = seqcount; - maxra = min(read_max, maxra); + maxra = min(vfs_read_max, maxra); maxra = min(nbuf/8, maxra); if (((u_quad_t)(lblkno + maxra + 1) * size) > filesize) maxra = (filesize / size) - lblkno; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 9453f73..ea735f3 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..3e473f3 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -37,12 +37,14 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include #include #include #include +#include #include #include #include @@ -62,6 +64,13 @@ __FBSDID("$FreeBSD$"); #include +#include +#include + +static int vmio_enabled = 1; +SYSCTL_INT(_vfs, OID_AUTO, vmio_enabled, CTLFLAG_RW, &vmio_enabled, 0, + "Use vm pages copyin/out instead of vops for read/write"); + static fo_rdwr_t vn_read; static fo_rdwr_t vn_write; static fo_truncate_t vn_truncate; @@ -83,6 +92,9 @@ struct fileops vnops = { .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; +static int vn_write_chunk(struct vnode *, struct uio *, struct ucred *, + struct ucred *, int); + int vn_open(ndp, flagp, cmode, fp) struct nameidata *ndp; @@ -333,7 +345,7 @@ sequential_heuristic(struct uio *uio, struct file *fp) * closely related to the best I/O size for real disks than * to any block size used by software. */ - fp->f_seqcount += howmany(uio->uio_resid, 16384); + fp->f_seqcount += howmany(uio->uio_resid, FRA_BLOCK_SZ); if (fp->f_seqcount > IO_SEQMAX) fp->f_seqcount = IO_SEQMAX; return (fp->f_seqcount << IO_SEQSHIFT); @@ -351,76 +363,72 @@ 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); + error = vn_write_chunk(vp, &auio, active_cred, cred, + ioflg); } if (aresid) *aresid = auio.uio_resid; @@ -428,10 +436,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,68 +506,148 @@ 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) { + if (!vmio_enabled || + (error = vnode_pager_read(vp, uio, ioflag)) == 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); + 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; + vn_unlock_foffset(fp, mtxp); + } + return (error); +} +static int +vn_write_chunk(struct vnode *vp, struct uio *uio, struct ucred *active_cred, + struct ucred *fcred, int ioflag) +{ + struct mount *mp, *mp1; + int error, lock_flags, vfslocked; + + mp = NULL; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + if (vp->v_type == VREG) + bwillwrite(); + if (vp->v_type != VCHR && + (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) + goto unlock; + + if (MNT_SHARED_WRITES(mp) || + (mp == NULL && (mp1 = vp->v_mount) != NULL && + MNT_SHARED_WRITES(mp1))) + lock_flags = LK_SHARED; + else + lock_flags = LK_EXCLUSIVE; + vn_lock(vp, lock_flags | LK_RETRY); #ifdef MAC - error = mac_vnode_check_read(active_cred, fp->f_cred, vp); - if (error == 0) + error = mac_vnode_check_write(active_cred, fcred, vp); +#else + error = 0; #endif - error = VOP_READ(vp, uio, ioflag, fp->f_cred); - 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); + if (error == 0) { + if (!vmio_enabled || + (error = vnode_pager_write(vp, uio, ioflag)) == EOPNOTSUPP) + error = VOP_WRITE(vp, uio, ioflag, fcred); } - fp->f_nextoff = uio->uio_offset; VOP_UNLOCK(vp, 0); + if (vp->v_type != VCHR) + vn_finished_write(mp); +unlock: VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -563,24 +656,17 @@ vn_read(fp, uio, active_cred, flags, td) * 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; +vn_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, + struct thread *td) { struct vnode *vp; - struct mount *mp; - int error, ioflag, lock_flags; - int vfslocked; + struct mtx *mtxp; + 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; - 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; @@ -591,36 +677,32 @@ vn_write(fp, uio, active_cred, flags, td) 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) { - lock_flags = LK_SHARED; - } else { - lock_flags = LK_EXCLUSIVE; - } - - vn_lock(vp, lock_flags | LK_RETRY); - if ((flags & FOF_OFFSET) == 0) + if ((flags & FOF_OFFSET) == 0) { + mtxp = vn_lock_foffset(fp); uio->uio_offset = fp->f_offset; + } else + mtxp = NULL; /* gcc */ ioflag |= sequential_heuristic(uio, fp); -#ifdef MAC - error = mac_vnode_check_write(active_cred, fp->f_cred, vp); - if (error == 0) -#endif - error = VOP_WRITE(vp, uio, ioflag, fp->f_cred); - if ((flags & FOF_OFFSET) == 0) + 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(vp, uio, active_cred, fp->f_cred, ioflag); + if (rl_cookie != NULL) + rangelock_unlock(vp, rl_cookie); + if ((flags & FOF_OFFSET) == 0) { fp->f_offset = uio->uio_offset; + vn_unlock_foffset(fp, mtxp); + } fp->f_nextoff = uio->uio_offset; - VOP_UNLOCK(vp, 0); - if (vp->v_type != VCHR) - vn_finished_write(mp); -unlock: - VFS_UNLOCK_GIANT(vfslocked); return (error); } diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 8f3b1b2..e6fdf7e 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -257,6 +257,8 @@ extern const char *buf_wmesg; /* Default buffer lock message */ #include /* XXX for curthread */ #include +extern int vfs_read_max; + /* * Initialize a lock. */ diff --git a/sys/sys/file.h b/sys/sys/file.h index 5c58e82..d71ba2c 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -141,6 +141,8 @@ struct file { #define FOFFSET_LOCKED 0x1 #define FOFFSET_LOCK_WAITING 0x2 +#define FRA_BLOCK_SZ 16384 + #endif /* _KERNEL || _WANT_FILE */ /* 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..6cbd226 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -463,7 +463,8 @@ ffs_read(ap) return error; } #endif - + KASSERT(vp->v_type != VREG || (vp->v_type == VREG && + 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 ad6087e..e24c62b 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_pageout.c b/sys/vm/vm_pageout.c index 19edce1..d02a006 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -349,7 +349,7 @@ more: } vm_page_test_dirty(p); if (p->dirty == 0 || - p->queue != PQ_INACTIVE || + (p->queue != PQ_INACTIVE && p->queue != PQ_ACTIVE) || p->wire_count != 0 || /* may be held by buf cache */ p->hold_count != 0) { /* may be undergoing I/O */ ib = 0; @@ -377,7 +377,7 @@ more: } vm_page_test_dirty(p); if (p->dirty == 0 || - p->queue != PQ_INACTIVE || + (p->queue != PQ_INACTIVE && p->queue != PQ_ACTIVE) || p->wire_count != 0 || /* may be held by buf cache */ p->hold_count != 0) { /* may be undergoing I/O */ break; @@ -484,7 +484,7 @@ vm_pageout_flush(vm_page_t *mc, int count, int flags) if (pageout_status[i] != VM_PAGER_PEND) { vm_object_pip_wakeup(object); vm_page_io_finish(mt); - if (vm_page_count_severe()) + if (mt->queue == PQ_INACTIVE && vm_page_count_severe()) vm_page_try_to_cache(mt); } } diff --git a/sys/vm/vm_readwrite.c b/sys/vm/vm_readwrite.c new file mode 100644 index 0000000..ad841ee --- /dev/null +++ b/sys/vm/vm_readwrite.c @@ -0,0 +1,529 @@ +/*- + * 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 +#include +#include +#include +#include + +/* + * XXXKIB TODO + * + * 1. Backpressure for writes + * 2. VOP_REALLOCBLKS + * + */ + +static int vmio_run = 0; +SYSCTL_INT(_debug, OID_AUTO, vmio_run, CTLFLAG_RW, &vmio_run, 0, + "Calculate the max sequential run for vnode_pager_read_cluster"); +static int vmio_read_pack = 16; +SYSCTL_INT(_vfs, OID_AUTO, vmio_read_pack, CTLFLAG_RW, &vmio_read_pack, 0, + "Length of the page pack for read"); +static int vmio_write_pack = 16; +SYSCTL_INT(_vfs, OID_AUTO, vmio_write_pack, CTLFLAG_RW, &vmio_write_pack, 0, + "Length of the page pack for write"); + +static u_int +io_page_bits(int i, vm_offset_t off, ssize_t size) +{ + int start, chunk; + + if (i == 0) { + start = off; + chunk = min(PAGE_SIZE - off, size); + } else if (i * PAGE_SIZE < off + size) { + start = 0; + chunk = PAGE_SIZE; + } else if ((i - 1) * PAGE_SIZE < off + size) { + start = 0; + chunk = (size - off) % PAGE_SIZE; + } else + return (0); + return (vm_page_bits(start, chunk)); +} + +/* + * 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. + * + * Returns NULL on error, and vnode vm_object unlocked. + */ +static vm_page_t +vnode_grab_next_page(struct vnode *vp, vm_page_t prev, vm_pindex_t pindex) +{ + vm_object_t object; + vm_page_t m; + int locked; + + object = vp->v_object; + 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); + locked = VOP_ISLOCKED(vp); + VOP_UNLOCK(vp, 0); + VM_WAIT; + vn_lock(vp, locked | LK_RETRY); + if (vp->v_iflag & VI_DOOMED) + return (NULL); + 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; + error = 0; + blkno = 0; + + if (vmio_run) { + VM_OBJECT_UNLOCK(obj); + error = VOP_BMAP(vp, IDX_TO_OFF(idx)/bsize, NULL, &blkno, &run, NULL); + 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); + } else { + if (maxrun == 0) + maxrun = 1; + run = MIN(maxrun, vp->v_mount->mnt_iosize_max / PAGE_SIZE); + } + if (IDX_TO_OFF(idx) + run * PAGE_SIZE > obj->un_pager.vnp.vnp_size) { + run = (obj->un_pager.vnp.vnp_size - IDX_TO_OFF(idx)) / + PAGE_SIZE; + } + pa[0] = m; + for (i = 1; i < run; i++) { + m = vnode_grab_next_page(vp, m, idx + i); + if (m == NULL) { + vm_page_lock_queues(); + for (i--; i >= 0; i--) + vm_page_free(pa[i]); + vm_page_unlock_queues(); + return (VM_PAGER_AGAIN); + } + if (m->valid) { + run = i; + break; + } + vm_page_busy(m); + pa[i] = m; + } + if (run == 0) + run = 1; + 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, seqcount, wp, i, j; + u_int bits; + boolean_t 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); + + wp = vmio_read_pack; + vm_page_t ma[wp + 1]; + + error = 0; + m = NULL; + vn_locked = VOP_ISLOCKED(vp); + obj_locked = FALSE; + td = uio->uio_td; + /* XXXKIB This should be disallowed. */ + if (td == NULL) + td = curthread; + + seqcount = (ioflags >> IO_SEQSHIFT) * FRA_BLOCK_SZ / PAGE_SIZE; + seqcount = min(vfs_read_max, seqcount); + seqcount = min(vp->v_mount->mnt_iosize_max / PAGE_SIZE, seqcount); + + while (uio->uio_resid > 0) { + if (!obj_locked) { + VM_OBJECT_LOCK(obj); + obj_locked = TRUE; + } + + 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 * wp - off, uio->uio_resid), size); + + wp = (size + off + PAGE_SIZE - 1) / PAGE_SIZE; + for (i = 0; i < wp; i++) { + ma[i] = m = vnode_grab_next_page(vp, m, idx + i); + if (m == NULL) { + vm_page_lock_queues(); + for (j = 0; j < i; j++) + vm_page_free(ma[j]); + vm_page_unlock_queues(); + error = EIO; + obj_locked = FALSE; + break; + } + bits = io_page_bits(i, off, size); + if ((m->valid & bits) != bits) { + vm_page_busy(m); + + /* + * Read page, honouring read-ahead settings + * for filedescriptor. + */ + error = vnode_pager_read_cluster(vp, m, + seqcount); + if (error != 0 && (vp->v_iflag & VI_DOOMED)) { + vm_page_lock_queues(); + for (j = 0; j < i; j++) + vm_page_free(ma[j]); + vm_page_unlock_queues(); + obj_locked = FALSE; + error = EBADF; + break; + } + m = vm_page_lookup(obj, idx + i); + if (m == NULL) { + if (error == VM_PAGER_OK) + continue; + vm_page_lock_queues(); + for (j = 0; j < i; j++) + vm_page_free(ma[j]); + vm_page_unlock_queues(); + error = EIO; + break; + } + if (m->valid == 0 || error != VM_PAGER_OK) { + vm_page_lock_queues(); + for (j = 0; j < i; j++) + vm_page_free(ma[j]); + vm_page_free(m); + vm_page_unlock_queues(); + error = EIO; + break; + } + ma[i] = m; + vm_page_wakeup(m); + } + } + if (error != 0) + break; + 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(ma, off, size, uio); + VM_OBJECT_LOCK(obj); + vm_page_io_finish(m); + vm_object_pip_wakeup(obj); + VM_OBJECT_UNLOCK(obj); + obj_locked = FALSE; + 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, wp, i, j; + u_int bits; + boolean_t obj_locked; + 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); + + wp = vmio_write_pack; + vm_page_t ma[wp + 1]; + + error = 0; + m = NULL; + vn_locked = VOP_ISLOCKED(vp); + obj_locked = FALSE; + 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. + * XXXKIB the check for the file type is kept on purpose. + */ + 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); + + /* + * Extend the file if writing past end. + */ + if (osize1 < uio->uio_offset + resid) { + vattr.va_size = uio->uio_offset + resid; + error = VOP_SETATTR(vp, &vattr, td->td_ucred); + if (error != 0) + return (error); + } + + 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 * wp - off, uio->uio_resid); + + if (!obj_locked) { + VM_OBJECT_LOCK(obj); + obj_locked = TRUE; + } + wp = (size + off + PAGE_SIZE - 1) / PAGE_SIZE; + for (i = 0; i < wp; i++) { + ma[i] = m = vnode_grab_next_page(vp, m, idx + i); + if (m == NULL) { + vm_page_lock_queues(); + for (j = 0; j < i; j++) + vm_page_free(ma[j]); + vm_page_unlock_queues(); + obj_locked = FALSE; + error = EIO; + break; + } + bits = io_page_bits(i, off, size); + + /* + * Do read if page is going to be only partially + * written. + */ + if ((m->valid & ~bits) != (~bits & VM_PAGE_BITS_ALL)) { + vm_page_busy(m); + error = vnode_pager_read_cluster(vp, m, wp - i); + if (error != 0 && (vp->v_iflag & VI_DOOMED)) { + vm_page_lock_queues(); + for (j = 0; j < i; j++) + vm_page_free(ma[j]); + vm_page_unlock_queues(); + obj_locked = FALSE; + error = EBADF; + break; + } + m = vm_page_lookup(obj, idx + i); + if (m == NULL) { + if (error == VM_PAGER_OK) + continue; + vm_page_lock_queues(); + for (j = 0; j < i; j++) + vm_page_free(ma[j]); + vm_page_unlock_queues(); + error = EIO; + break; + } + if (m->valid == 0 || error != VM_PAGER_OK) { + vm_page_lock_queues(); + for (j = 0; j < i; j++) + vm_page_free(ma[j]); + vm_page_free(m); + vm_page_unlock_queues(); + error = EIO; + break; + } + ma[i] = m; + vm_page_wakeup(m); + } + } + if (error != 0) + break; + vm_object_pip_add(obj, 1); + for (i = 0; i < wp; i++) + vm_page_io_start(ma[i]); + VM_OBJECT_UNLOCK(obj); + VOP_UNLOCK(vp, 0); + sresid = uio->uio_resid; + error = uiomove_fromphys(ma, off, size, uio); + VM_OBJECT_LOCK(obj); + if (error == 0) { + if (uio->uio_offset > osize1) + osize1 = uio->uio_offset; + /* + * Note that the page and object are dirty. + */ + vm_page_lock_queues(); + for (i = 0; i < wp; i++) { + j = io_page_bits(i, off, sresid - + uio->uio_resid); + ma[i]->valid |= j; + ma[i]->dirty |= j; + } + vm_page_unlock_queues(); + vm_object_set_writeable_dirty(obj); + } + for (i = 0; i < wp; i++) + vm_page_io_finish(ma[i]); + vm_object_pip_wakeup(obj); + if (error == 0 && (ioflags & IO_SYNC)) + vm_object_page_clean(obj, idx, idx + wp, ioflags); + VM_OBJECT_UNLOCK(obj); + obj_locked = FALSE; + 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/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index faa6f37..a49d042 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -1076,6 +1076,7 @@ vnode_pager_generic_putpages(vp, m, bytecount, flags, rtvals) object = vp->v_object; count = bytecount / PAGE_SIZE; +/* printf("vpgp: %p %jd %x %d\n", vp, m[0]->pindex, m[0]->dirty, count); */ for (i = 0; i < count; i++) rtvals[i] = VM_PAGER_AGAIN; 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); +}