GENERIC HEAD from 2013-10-06 19:47:06 UTC, r256095M, vmcore.76 GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2013 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 10.0-ALPHA5 #1 r256095M: Tue Oct 8 11:14:50 CEST 2013 pho@t1.osted.lan:/usr/src/sys/amd64/compile/PHO amd64 FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. CPU: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz (1995.24-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x206d7 Family = 0x6 Model = 0x2d Stepping = 7 Features=0xbfebfbff Features2=0x1fbee3ff AMD Features=0x2c100800 AMD Features2=0x1 TSC: P-state invariant, performance statistics real memory = 68719476736 (65536 MB) avail memory = 32153194496 (30663 MB) : Trying to mount root from ufs:/dev/da0p2 [rw]... Setting hostuuid: 3141f787-07e3-e111-b968-001e6756c168. Setting hostid: 0x564ac5b6. Starting ddb. Entropy harvesting: interrupts ethernet point_to_point kickstart. Starting file system checks: /dev/da0p2: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/da0p2: clean, 82311546 free (139474 frags, 10271509 blocks, 0.1% fragmentation) /dev/da0p3: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/da0p3: clean, 21999915 free (339 frags, 2749947 blocks, 0.0% fragmentation) Running softdepflush at pid 70 Start thread / worker Mounting local file systems:Start thread /tmp. worker lock order reversal: 1st 0xfffff8012158ba28 ufs (ufs) @ kern/vfs_subr.c:2099 2nd 0xfffffe0785e32278 bufwait (bufwait) @ ufs/ffs/ffs_vnops.c:262 3rd 0xfffff80121cad7b8 ufs (ufs) @ kern/vfs_subr.c:2099 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe081def1bb0 kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe081def1c60 witness_checkorder() at witness_checkorder+0xd23/frame 0xfffffe081def1cf0 __lockmgr_args() at __lockmgr_args+0x86c/frame 0xfffffe081def1e20 ffs_lock() at ffs_lock+0x92/frame 0xfffffe081def1e70 VOP_LOCK1_APV() at VOP_LOCK1_APV+0xf5/frame 0xfffffe081def1ea0 _vn_lock() at _vn_lock+0xc6/frame 0xfffffe081def1f10 vget() at vget+0x70/frame 0xfffffe081def1f60 vfs_hash_get() at vfs_hash_get+0xf5/frame 0xfffffe081def1fb0 ffs_vgetf() at ffs_vgetf+0x59/frame 0xfffffe081def20b0 flush_pagedep_deps() at flush_pagedep_deps+0x49d/frame 0xfffffe081def2130 softdep_sync_buf() at softdep_sync_buf+0x4ca/frame 0xfffffe081def21d0 ffs_syncvnode() at ffs_syncvnode+0x258/frame 0xfffffe081def2250 ffs_truncate() at ffs_truncate+0x5f3/frame 0xfffffe081def2430 ufs_direnter() at ufs_direnter+0x891/frame 0xfffffe081def24f0 ufs_makeinode() at ufs_makeinode+0x573/frame 0xfffffe081def26b0 VOP_CREATE_APV() at VOP_CREATE_APV+0x108/frame 0xfffffe081def26e0 vn_open_cred() at vn_open_cred+0x2f0/frame 0xfffffe081def2830 kern_openat() at kern_openat+0x261/frame 0xfffffe081def29a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081def2ab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081def2ab0 --- syscall (5, FreeBSD ELF64, sys_open), rip = 0x800dd926a, rsp = 0x7fffffffc4f8, rbp = 0x7fffffffc5e0 --- Writing entropy file:. Setting hostname: t1.osted.lan. Starting Network: lo0 igb0 igb1. lo0: flags=8049 metric 0 mtu 16384 options=600003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 inet 127.0.0.1 netmask 0xff000000 nd6 options=21 igb0: flags=8843 metric 0 mtu 1500 options=401bb ether 00:1e:67:56:c1:68 inet 192.168.1.108 netmask 0xffffff00 broadcast 192.168.1.255 inet6 fe80::21e:67ff:fe56:c168%igb0 prefixlen 64 scopeid 0x1 nd6 options=29 media: Ethernet autoselect (100baseTX ) status: active igb1: flags=8c02 metric 0 mtu 1500 options=401bb ether 00:1e:67:56:c1:69 nd6 options=29 media: Ethernet autoselect status: no carrier Starting devd. Starting Network: igb1. igb1: flags=8c02 metric 0 mtu 1500 options=401bb ether 00:1e:67:56:c1:69 nd6 options=29 media: Ethernet autoselect status: no carrier Configuring keyboard: keymap. ums0: on usbus2 ums0: 3 buttons and [Z] coordinates ID=0 Starting ums0 moused. Expensive timeout(9) function: 0xffffffff806f67f0(0xffffffff816b36b0) 0.004136326 s add net default: gateway 192.168.1.1 add net fe80::: gateway ::1 add net ff02::: gateway ::1 add net ::ffff:0.0.0.0: gateway ::1 add net ::0.0.0.0: gateway ::1 ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/nss /usr/local/lib/qt4 32-bit compatibility ldconfig path: /usr/lib32 Creating and/or trimming log files. Starting syslogd. Starting watchdogd. No core dumps found. Starting rpcbind. NFS access cache time=60 rpc.umntall: 127.0.0.1: MOUNTPROG: RPC: Program not registered rpc.umntall: 127.0.0.1: MOUNTPROG: RPC: Program not registered lock order reversal: 1st 0xfffffe0785ecdd78 bufwait (bufwait) @ kern/vfs_bio.c:3049 2nd 0xfffff80121c38000 dirhash (dirhash) @ ufs/ufs/ufs_dirhash.c:284 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe081deed2d0 kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe081deed380 witness_checkorder() at witness_checkorder+0xd23/frame 0xfffffe081deed410 _sx_xlock() at _sx_xlock+0x75/frame 0xfffffe081deed450 ufsdirhash_add() at ufsdirhash_add+0x4c/frame 0xfffffe081deed490 ufs_direnter() at ufs_direnter+0x688/frame 0xfffffe081deed550 ufs_mkdir() at ufs_mkdir+0x863/frame 0xfffffe081deed750 VOP_MKDIR_APV() at VOP_MKDIR_APV+0x10e/frame 0xfffffe081deed780 kern_mkdirat() at kern_mkdirat+0x1f3/frame 0xfffffe081deed9a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081deedab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081deedab0 --- syscall (136, FreeBSD ELF64, sys_mkdir), rip = 0x80093951a, rsp = 0x7fffffffd798, rbp = 0x7fffffffdc70 --- Clearing /tmp (X related). Starting nfsuserd. Starting mountd. Starting nfsd. Recovering vi editor sessions:. Updating motd:. Mounting late file systems:. Starting ntpd. Starting powerd. Configuring syscons: keymap blanktime. Performing sanity check on sshd configuration. Starting sshd. Starting cron. Local package initialization: backup. Starting default mousedmoused: unable to open /dev/psm0: No such file or directory . Tue Oct 8 11:31:04 CEST 2013 FreeBSD/amd64 (t1.osted.lan) Expensive timeout(9) function: 0xffffffff806f67f0(0xffffffff816b36b0) 0.014109735 s (console) login: Oct 8 11:46:49 t1 su: pho to root on /dev/pts/0 20131008 11:46:54 all (1/1): netflix.sh Start thread /mnt worker Start thread /mnt2 worker lock order reversal: 1st 0xfffff80121cada28 ufs (ufs) @ kern/vfs_mount.c:1237 2nd 0xfffff80255a5aa28 devfs (devfs) @ ufs/ffs/ffs_softdep.c:1894 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe081e0e03c0 kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe081e0e0470 witness_checkorder() at witness_checkorder+0xd23/frame 0xfffffe081e0e0500 __lockmgr_args() at __lockmgr_args+0x86c/frame 0xfffffe081e0e0630 vop_stdlock() at vop_stdlock+0x3c/frame 0xfffffe081e0e0650 VOP_LOCK1_APV() at VOP_LOCK1_APV+0xf5/frame 0xfffffe081e0e0680 _vn_lock() at _vn_lock+0xc6/frame 0xfffffe081e0e06f0 softdep_flushworklist() at softdep_flushworklist+0x83/frame 0xfffffe081e0e0740 ffs_sync() at ffs_sync+0x33a/frame 0xfffffe081e0e07f0 dounmount() at dounmount+0x3e1/frame 0xfffffe081e0e0870 sys_unmount() at sys_unmount+0x356/frame 0xfffffe081e0e09a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081e0e0ab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081e0e0ab0 --- syscall (22, FreeBSD ELF64, sys_unmount), rip = 0x80088b17a, rsp = 0x7fffffffcf08, rbp = 0x7fffffffd020 --- Stop thread /mnt2 worker Stop thread /mnt worker 20131008 11:51:27 all (1/1): netflix.sh Start thread /mnt worker Start thread /mnt2 worker Stop thread /mnt2 worker Stop thread /mnt worker 20131008 11:55:47 all (1/1): netflix.sh Start thread /mnt worker Start thread /mnt2 worker Stop thread /mnt2 worker Stop thread /mnt worker 20131008 12:00:09 all (1/1): netflix.sh Start thread /mnt worker Start thread /mnt2 worker Stop thread /mnt2 worker Stop thread /mnt worker 20131008 12:04:36 all (1/1): netflix.sh Start thread /mnt worker Start thread /mnt2 worker ffs_fsync: dirty 0xfffff8027401c270: tag ufs, type VDIR usecount 2, writecount 0, refcount 11 mountedhere 0 flags (VI_ACTIVE) v_object 0xfffff802821d3a00 ref 0 pages 52 cleanbuf 1 dirtybuf 7 lock type ufs: EXCL by thread 0xfffff80121d4c000 (pid 2097, netflix, tid 100252) #0 0xffffffff8089dc4f at __lockmgr_args+0x108f #1 0xffffffff80b21c22 at ffs_lock+0x92 #2 0xffffffff80dd7175 at VOP_LOCK1_APV+0xf5 #3 0xffffffff809723c6 at _vn_lock+0xc6 #4 0xffffffff80957167 at lookup+0x107 #5 0xffffffff80956d04 at namei+0x544 #6 0xffffffff8096c911 at kern_unlinkat+0xa1 #7 0xffffffff80ccb132 at amd64_syscall+0x282 #8 0xffffffff80cafd1b at Xfast_syscall+0xfb ino 101678, on dev md6a ffs_fsync: dirty 0xfffff802885b8c30: tag ufs, type VDIR usecount 2, writecount 0, refcount 11 mountedhere 0 flags (VI_ACTIVE) v_object 0xfffff8028df17000 ref 0 pages 52 cleanbuf 1 dirtybuf 7 lock type ufs: EXCL by thread 0xfffff8025a9c8490 (pid 2087, netflix, tid 100296) #0 0xffffffff8089dc4f at __lockmgr_args+0x108f #1 0xffffffff80b21c22 at ffs_lock+0x92 #2 0xffffffff80dd7175 at VOP_LOCK1_APV+0xf5 #3 0xffffffff809723c6 at _vn_lock+0xc6 #4 0xffffffff80957167 at lookup+0x107 #5 0xffffffff80956d04 at namei+0x544 #6 0xffffffff8096c911 at kern_unlinkat+0xa1 #7 0xffffffff80ccb132 at amd64_syscall+0x282 #8 0xffffffff80cafd1b at Xfast_syscall+0xfb ino 101486, on dev md6a Shutting down local packages:. Stopping cron. Waiting for PIDS: 977. Stopping sshd. Waiting for PIDS: 967. Stopping powerd. Waiting for PIDS: 938. Stopping ntpd. Waiting for PIDS: 935. Stopping nfsd. Waiting for PIDS: 895 897. Stopping mountd. Waiting for PIDS: 889. Stopping nfsuserd. Waiting for PIDS: 878 879 880 881 882. rpc.umntall: 127.0.0.1: MOUNTPROG: RPC: Program not registered rpc.umntall: 127.0.0.1: MOUNTPROG: RPC: Program not registered Stopping rpcbind. Waiting for PIDS: 848. Stopping watchdogd. Waiting for PIDS: 83490 second watchdog timeout expired. Shutdown terminated. Tue Oct 8 12:27:36 CEST 2013 Oct 8 12:27:36 t1 init: /bin/sh on /etc/rc.shutdown terminated abnormally, going to single user mode Oct 8 12:27:36 t1 syslogd: exiting on signal 15 Oct 8 12:27:56 init: some processes would not die; ps axl advised Enter full pathname of shell or RETURN for /bin/sh: # KDB: enter: Break to debugger [ thread pid 11 tid 100004 ] Stopped at kdb_alt_break_internal+0x17f: movq $0,kdb_why db> run pho db:0:pho> bt Tracing pid 11 tid 100004 td 0xfffff8000b21c490 kdb_alt_break_internal() at kdb_alt_break_internal+0x17f/frame 0xfffffe078aa40730 kdb_alt_break() at kdb_alt_break+0xb/frame 0xfffffe078aa40740 uart_intr_rxready() at uart_intr_rxready+0x96/frame 0xfffffe078aa40770 uart_intr() at uart_intr+0x111/frame 0xfffffe078aa407b0 intr_event_handle() at intr_event_handle+0x8c/frame 0xfffffe078aa40800 intr_execute_handlers() at intr_execute_handlers+0x48/frame 0xfffffe078aa40830 lapic_handle_intr() at lapic_handle_intr+0x73/frame 0xfffffe078aa40860 Xapic_isr1() at Xapic_isr1+0xa4/frame 0xfffffe078aa40860 --- interrupt, rip = 0xffffffff80caab36, rsp = 0xfffffe078aa40920, rbp = 0xfffffe078aa40930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa40930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa40980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa409a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa409c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa40a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa40ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa40ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa40b70, rbp = 0 --- db:0:bt> show allpcpu Current CPU: 1 cpuid = 0 dynamic pcpu = 0x5be000 curthread = 0xfffff8000b21c920: pid 11 "idle: cpu0" curpcb = 0xfffffe078aa3bb80 fpcurthread = none idlethread = 0xfffff8000b21c920: tid 100003 "idle: cpu0" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171de90 commontssp = 0xffffffff8171de90 rsp0 = 0xfffffe078aa3bb80 gs32p = 0xffffffff8171f8e8 ldt = 0xffffffff8171f928 tss = 0xffffffff8171f918 spin locks held: cpuid = 1 dynamic pcpu = 0xfffffe087aeef000 curthread = 0xfffff8000b21c490: pid 11 "idle: cpu1" curpcb = 0xfffffe078aa40b80 fpcurthread = none idlethread = 0xfffff8000b21c490: tid 100004 "idle: cpu1" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171def8 commontssp = 0xffffffff8171def8 rsp0 = 0xfffffe078aa40b80 gs32p = 0xffffffff8171f950 ldt = 0xffffffff8171f990 tss = 0xffffffff8171f980 spin locks held: cpuid = 2 dynamic pcpu = 0xfffffe087aef7000 curthread = 0xfffff8000b21c000: pid 11 "idle: cpu2" curpcb = 0xfffffe078aa45b80 fpcurthread = none idlethread = 0xfffff8000b21c000: tid 100005 "idle: cpu2" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171df60 commontssp = 0xffffffff8171df60 rsp0 = 0xfffffe078aa45b80 gs32p = 0xffffffff8171f9b8 ldt = 0xffffffff8171f9f8 tss = 0xffffffff8171f9e8 spin locks held: cpuid = 3 dynamic pcpu = 0xfffffe087aeff000 curthread = 0xfffff8000b231000: pid 11 "idle: cpu3" curpcb = 0xfffffe078aa4ab80 fpcurthread = none idlethread = 0xfffff8000b231000: tid 100006 "idle: cpu3" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171dfc8 commontssp = 0xffffffff8171dfc8 rsp0 = 0xfffffe078aa4ab80 gs32p = 0xffffffff8171fa20 ldt = 0xffffffff8171fa60 tss = 0xffffffff8171fa50 spin locks held: cpuid = 4 dynamic pcpu = 0xfffffe087af07000 curthread = 0xfffff8000b230920: pid 11 "idle: cpu4" curpcb = 0xfffffe078aa4fb80 fpcurthread = none idlethread = 0xfffff8000b230920: tid 100007 "idle: cpu4" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e030 commontssp = 0xffffffff8171e030 rsp0 = 0xfffffe078aa4fb80 gs32p = 0xffffffff8171fa88 ldt = 0xffffffff8171fac8 tss = 0xffffffff8171fab8 spin locks held: cpuid = 5 dynamic pcpu = 0xfffffe087af0f000 curthread = 0xfffff8000b230490: pid 11 "idle: cpu5" curpcb = 0xfffffe078aa54b80 fpcurthread = none idlethread = 0xfffff8000b230490: tid 100008 "idle: cpu5" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e098 commontssp = 0xffffffff8171e098 rsp0 = 0xfffffe078aa54b80 gs32p = 0xffffffff8171faf0 ldt = 0xffffffff8171fb30 tss = 0xffffffff8171fb20 spin locks held: cpuid = 6 dynamic pcpu = 0xfffffe087af17000 curthread = 0xfffff8000b230000: pid 11 "idle: cpu6" curpcb = 0xfffffe078aa59b80 fpcurthread = none idlethread = 0xfffff8000b230000: tid 100009 "idle: cpu6" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e100 commontssp = 0xffffffff8171e100 rsp0 = 0xfffffe078aa59b80 gs32p = 0xffffffff8171fb58 ldt = 0xffffffff8171fb98 tss = 0xffffffff8171fb88 spin locks held: cpuid = 7 dynamic pcpu = 0xfffffe087af1f000 curthread = 0xfffff8000b222920: pid 11 "idle: cpu7" curpcb = 0xfffffe078aa5eb80 fpcurthread = none idlethread = 0xfffff8000b222920: tid 100010 "idle: cpu7" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e168 commontssp = 0xffffffff8171e168 rsp0 = 0xfffffe078aa5eb80 gs32p = 0xffffffff8171fbc0 ldt = 0xffffffff8171fc00 tss = 0xffffffff8171fbf0 spin locks held: cpuid = 8 dynamic pcpu = 0xfffffe087af27000 curthread = 0xfffff8000b232920: pid 11 "idle: cpu8" curpcb = 0xfffffe078aa63b80 fpcurthread = none idlethread = 0xfffff8000b232920: tid 100011 "idle: cpu8" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e1d0 commontssp = 0xffffffff8171e1d0 rsp0 = 0xfffffe078aa63b80 gs32p = 0xffffffff8171fc28 ldt = 0xffffffff8171fc68 tss = 0xffffffff8171fc58 spin locks held: cpuid = 9 dynamic pcpu = 0xfffffe087af2f000 curthread = 0xfffff8000b232490: pid 11 "idle: cpu9" curpcb = 0xfffffe078aa68b80 fpcurthread = none idlethread = 0xfffff8000b232490: tid 100012 "idle: cpu9" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e238 commontssp = 0xffffffff8171e238 rsp0 = 0xfffffe078aa68b80 gs32p = 0xffffffff8171fc90 ldt = 0xffffffff8171fcd0 tss = 0xffffffff8171fcc0 spin locks held: cpuid = 10 dynamic pcpu = 0xfffffe087af37000 curthread = 0xfffff8000b232000: pid 11 "idle: cpu10" curpcb = 0xfffffe078aa6db80 fpcurthread = none idlethread = 0xfffff8000b232000: tid 100013 "idle: cpu10" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e2a0 commontssp = 0xffffffff8171e2a0 rsp0 = 0xfffffe078aa6db80 gs32p = 0xffffffff8171fcf8 ldt = 0xffffffff8171fd38 tss = 0xffffffff8171fd28 spin locks held: cpuid = 11 dynamic pcpu = 0xfffffe087af3f000 curthread = 0xfffff8000b231920: pid 11 "idle: cpu11" curpcb = 0xfffffe078aa72b80 fpcurthread = none idlethread = 0xfffff8000b231920: tid 100014 "idle: cpu11" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e308 commontssp = 0xffffffff8171e308 rsp0 = 0xfffffe078aa72b80 gs32p = 0xffffffff8171fd60 ldt = 0xffffffff8171fda0 tss = 0xffffffff8171fd90 spin locks held: cpuid = 12 dynamic pcpu = 0xfffffe087af47000 curthread = 0xfffff8000b231490: pid 11 "idle: cpu12" curpcb = 0xfffffe078aa77b80 fpcurthread = none idlethread = 0xfffff8000b231490: tid 100015 "idle: cpu12" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e370 commontssp = 0xffffffff8171e370 rsp0 = 0xfffffe078aa77b80 gs32p = 0xffffffff8171fdc8 ldt = 0xffffffff8171fe08 tss = 0xffffffff8171fdf8 spin locks held: cpuid = 13 dynamic pcpu = 0xfffffe087af4f000 curthread = 0xfffff8000b234490: pid 11 "idle: cpu13" curpcb = 0xfffffe078aa7cb80 fpcurthread = none idlethread = 0xfffff8000b234490: tid 100016 "idle: cpu13" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e3d8 commontssp = 0xffffffff8171e3d8 rsp0 = 0xfffffe078aa7cb80 gs32p = 0xffffffff8171fe30 ldt = 0xffffffff8171fe70 tss = 0xffffffff8171fe60 spin locks held: cpuid = 14 dynamic pcpu = 0xfffffe087af57000 curthread = 0xfffff8000b234000: pid 11 "idle: cpu14" curpcb = 0xfffffe078aa81b80 fpcurthread = none idlethread = 0xfffff8000b234000: tid 100017 "idle: cpu14" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e440 commontssp = 0xffffffff8171e440 rsp0 = 0xfffffe078aa81b80 gs32p = 0xffffffff8171fe98 ldt = 0xffffffff8171fed8 tss = 0xffffffff8171fec8 spin locks held: cpuid = 15 dynamic pcpu = 0xfffffe087af5f000 curthread = 0xfffff8000b233920: pid 11 "idle: cpu15" curpcb = 0xfffffe078aa86b80 fpcurthread = none idlethread = 0xfffff8000b233920: tid 100018 "idle: cpu15" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e4a8 commontssp = 0xffffffff8171e4a8 rsp0 = 0xfffffe078aa86b80 gs32p = 0xffffffff8171ff00 ldt = 0xffffffff8171ff40 tss = 0xffffffff8171ff30 spin locks held: cpuid = 16 dynamic pcpu = 0xfffffe087af67000 curthread = 0xfffff8000b233490: pid 11 "idle: cpu16" curpcb = 0xfffffe078aa8bb80 fpcurthread = none idlethread = 0xfffff8000b233490: tid 100019 "idle: cpu16" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e510 commontssp = 0xffffffff8171e510 rsp0 = 0xfffffe078aa8bb80 gs32p = 0xffffffff8171ff68 ldt = 0xffffffff8171ffa8 tss = 0xffffffff8171ff98 spin locks held: cpuid = 17 dynamic pcpu = 0xfffffe087af6f000 curthread = 0xfffff8000b233000: pid 11 "idle: cpu17" curpcb = 0xfffffe078aa90b80 fpcurthread = none idlethread = 0xfffff8000b233000: tid 100020 "idle: cpu17" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e578 commontssp = 0xffffffff8171e578 rsp0 = 0xfffffe078aa90b80 gs32p = 0xffffffff8171ffd0 ldt = 0xffffffff81720010 tss = 0xffffffff81720000 spin locks held: cpuid = 18 dynamic pcpu = 0xfffffe087af77000 curthread = 0xfffff8000b238000: pid 11 "idle: cpu18" curpcb = 0xfffffe078aa95b80 fpcurthread = none idlethread = 0xfffff8000b238000: tid 100021 "idle: cpu18" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e5e0 commontssp = 0xffffffff8171e5e0 rsp0 = 0xfffffe078aa95b80 gs32p = 0xffffffff81720038 ldt = 0xffffffff81720078 tss = 0xffffffff81720068 spin locks held: cpuid = 19 dynamic pcpu = 0xfffffe087af7f000 curthread = 0xfffff8000b237920: pid 11 "idle: cpu19" curpcb = 0xfffffe078aa9ab80 fpcurthread = none idlethread = 0xfffff8000b237920: tid 100022 "idle: cpu19" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e648 commontssp = 0xffffffff8171e648 rsp0 = 0xfffffe078aa9ab80 gs32p = 0xffffffff817200a0 ldt = 0xffffffff817200e0 tss = 0xffffffff817200d0 spin locks held: cpuid = 20 dynamic pcpu = 0xfffffe087af87000 curthread = 0xfffff801210aa920: pid 4 "enc_daemon0" curpcb = 0xfffffe081dbcbb80 fpcurthread = none idlethread = 0xfffff8000b237490: tid 100023 "idle: cpu20" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e6b0 commontssp = 0xffffffff8171e6b0 rsp0 = 0xfffffe081dbcbb80 gs32p = 0xffffffff81720108 ldt = 0xffffffff81720148 tss = 0xffffffff81720138 spin locks held: cpuid = 21 dynamic pcpu = 0xfffffe087af8f000 curthread = 0xfffff8000b237000: pid 11 "idle: cpu21" curpcb = 0xfffffe078aaa4b80 fpcurthread = none idlethread = 0xfffff8000b237000: tid 100024 "idle: cpu21" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e718 commontssp = 0xffffffff8171e718 rsp0 = 0xfffffe078aaa4b80 gs32p = 0xffffffff81720170 ldt = 0xffffffff817201b0 tss = 0xffffffff817201a0 spin locks held: cpuid = 22 dynamic pcpu = 0xfffffe087af97000 curthread = 0xfffff8000b234920: pid 11 "idle: cpu22" curpcb = 0xfffffe078aaa9b80 fpcurthread = none idlethread = 0xfffff8000b234920: tid 100025 "idle: cpu22" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e780 commontssp = 0xffffffff8171e780 rsp0 = 0xfffffe078aaa9b80 gs32p = 0xffffffff817201d8 ldt = 0xffffffff81720218 tss = 0xffffffff81720208 spin locks held: cpuid = 23 dynamic pcpu = 0xfffffe08095c7000 curthread = 0xfffff8000b239920: pid 11 "idle: cpu23" curpcb = 0xfffffe078aaaeb80 fpcurthread = none idlethread = 0xfffff8000b239920: tid 100026 "idle: cpu23" curpmap = 0xffffffff81706988 tssp = 0xffffffff8171e7e8 commontssp = 0xffffffff8171e7e8 rsp0 = 0xfffffe078aaaeb80 gs32p = 0xffffffff81720240 ldt = 0xffffffff81720280 tss = 0xffffffff81720270 spin locks held: db:0:allpcpu> show alllocks Process 4 (enc_daemon0) thread 0xfffff801210aa920 (100127) exclusive sleep mutex pmap (pmap) r = 0 (0xffffffff81736fd8) locked @ amd64/amd64/pmap.c:3588 shared rw pmap pv global (pmap pv global) r = 0 (0xffffffff816a0700) locked @ amd64/amd64/pmap.c:3587 exclusive rw kmem vm object (kmem vm object) r = 0 (0xffffffff81715358) locked @ vm/vm_kern.c:400 exclusive sx enccache (enccache) r = 0 (0xfffff800170c48a0) locked @ cam/scsi/scsi_enc_ses.c:1917 db:0:alllocks> show lockedvnods Locked vnodes db:0:lockedvnods> show mount 0xfffff8012148fb58 /dev/da0p2 on / (ufs) 0xfffff80121490000 devfs on /dev (devfs) 0xfffff80121c213c8 /dev/da0p3 on /tmp (ufs) 0xfffff80121c67790 procfs on /proc (procfs) 0xfffff802a89ee000 /dev/md5a on /mnt (ufs) 0xfffff8012148f790 /dev/md6a on /mnt2 (ufs) More info: show mount db:0:mount> ps pid ppid pgrp uid state wmesg wchan cmd 2355 1 2355 0 Ss+ ttyin 0xfffff8000b24c8a8 sh 2104 1 834 0 D suspfs 0xfffff802a89ee098 ls 2098 1 2078 1002 D+ suspfs 0xfffff8012148f828 netflix 2096 1 2078 1002 D+ suspfs 0xfffff8012148f828 netflix 2094 1 2078 1002 D+ suspfs 0xfffff8012148f828 netflix 2091 1 2078 1002 D+ suspfs 0xfffff8012148f828 netflix 2090 1 2077 1002 D+ suspfs 0xfffff802a89ee098 netflix 2087 1 2078 1002 D+ suspfs 0xfffff8012148f828 netflix 2085 1 2078 1002 DE+ suspfs 0xfffff8012148f828 netflix 2070 0 0 0 DL mdwait 0xfffff80121041000 [md6] 2057 0 0 0 DL mdwait 0xfffff802a8ba6000 [md5] 70 0 0 0 DL (threaded) [softdepflush] 100321 D sdflush 0xffffffff81699050 [/mnt2 worker] 100320 D sdflush 0xffffffff81699050 [/mnt worker] 100149 D sdflush 0xffffffff81699050 [/tmp worker] 100148 D sdflush 0xffffffff81699050 [/ worker] 16 0 0 0 DL vlruwt 0xfffff8012115c4b8 [vnlru] 9 0 0 0 DL syncer 0xffffffff816923b0 [syncer] 8 0 0 0 DL psleep 0xffffffff81691d84 [bufdaemon] 7 0 0 0 DL pgzero 0xffffffff8169a68c [pagezero] 6 0 0 0 DL psleep 0xffffffff81699dc0 [vmdaemon] 5 0 0 0 DL psleep 0xffffffff8171d704 [pagedaemon] 4 0 0 0 RL CPU 20 [enc_daemon0] 3 0 0 0 DL ccb_scan 0xffffffff81465130 [xpt_thrd] 2 0 0 0 DL waiting_ 0xffffffff81711578 [sctp_iterator] 15 0 0 0 DL (threaded) [usb] 100119 D - 0xfffffe0001177e18 [usbus2] 100118 D - 0xfffffe0001177dc0 [usbus2] 100117 D - 0xfffffe0001177d68 [usbus2] 100116 D - 0xfffffe0001177d10 [usbus2] 100114 D - 0xfffffe00011701b0 [usbus1] 100113 D - 0xfffffe0001170158 [usbus1] 100112 D - 0xfffffe0001170100 [usbus1] 100111 D - 0xfffffe00011700a8 [usbus1] 100074 D - 0xfffffe0000ebde18 [usbus0] 100073 D - 0xfffffe0000ebddc0 [usbus0] 100072 D - 0xfffffe0000ebdd68 [usbus0] 100071 D - 0xfffffe0000ebdd10 [usbus0] 14 0 0 0 DL - 0xffffffff8147e2a0 [rand_harvestq] 13 0 0 0 DL (threaded) [geom] 100055 D - 0xffffffff81705e20 [g_down] 100054 D - 0xffffffff81705e18 [g_up] 100053 D - 0xffffffff81705e10 [g_event] 12 0 0 0 WL (threaded) [intr] 100122 I [swi0: uart] 100121 I [irq287: hdac1] 100120 I [irq286: ahci0] 100115 I [irq20: ehci1] 100110 I [irq285: xhci0] 100109 I [irq284: igb1:link] 100107 I [irq283: igb1:que 7] 100105 I [irq282: igb1:que 6] 100103 I [irq281: igb1:que 5] 100101 I [irq280: igb1:que 4] 100099 I [irq279: igb1:que 3] 100097 I [irq278: igb1:que 2] 100095 I [irq277: igb1:que 1] 100093 I [irq276: igb1:que 0] 100092 I [irq275: igb0:link] 100090 I [irq274: igb0:que 7] 100088 I [irq273: igb0:que 6] 100086 I [irq272: igb0:que 5] 100084 I [irq271: igb0:que 4] 100082 I [irq270: igb0:que 3] 100080 I [irq269: igb0:que 2] 100078 I [irq268: igb0:que 1] 100076 I [irq267: igb0:que 0] 100075 I [irq266: hdac0] 100070 I [irq22: ehci0] 100069 I [irq265: isci0] 100068 I [irq264: isci0] 100065 I [swi6: Giant taskq] 100064 I [swi6: task queue] 100059 I [swi2: cambio] 100058 I [swi5: fast taskq] 100052 I [swi1: netisr 0] 100051 I [swi4: clock] 100050 I [swi4: clock] 100049 I [swi4: clock] 100048 I [swi4: clock] 100047 I [swi4: clock] 100046 I [swi4: clock] 100045 I [swi4: clock] 100044 I [swi4: clock] 100043 I [swi4: clock] 100042 I [swi4: clock] 100041 I [swi4: clock] 100040 I [swi4: clock] 100039 I [swi4: clock] 100038 I [swi4: clock] 100037 I [swi4: clock] 100036 I [swi4: clock] 100035 I [swi4: clock] 100034 I [swi4: clock] 100033 I [swi4: clock] 100032 I [swi4: clock] 100031 I [swi4: clock] 100030 I [swi4: clock] 100029 I [swi4: clock] 100028 I [swi4: clock] 100027 I [swi3: vm] 11 0 0 0 RL (threaded) [idle] 100026 Run CPU 23 [idle: cpu23] 100025 Run CPU 22 [idle: cpu22] 100024 Run CPU 21 [idle: cpu21] 100023 CanRun [idle: cpu20] 100022 Run CPU 19 [idle: cpu19] 100021 Run CPU 18 [idle: cpu18] 100020 Run CPU 17 [idle: cpu17] 100019 Run CPU 16 [idle: cpu16] 100018 Run CPU 15 [idle: cpu15] 100017 Run CPU 14 [idle: cpu14] 100016 Run CPU 13 [idle: cpu13] 100015 Run CPU 12 [idle: cpu12] 100014 Run CPU 11 [idle: cpu11] 100013 Run CPU 10 [idle: cpu10] 100012 Run CPU 9 [idle: cpu9] 100011 Run CPU 8 [idle: cpu8] 100010 Run CPU 7 [idle: cpu7] 100009 Run CPU 6 [idle: cpu6] 100008 Run CPU 5 [idle: cpu5] 100007 Run CPU 4 [idle: cpu4] 100006 Run CPU 3 [idle: cpu3] 100005 Run CPU 2 [idle: cpu2] 100004 Run CPU 1 [idle: cpu1] 100003 Run CPU 0 [idle: cpu0] 1 0 1 0 SLs wait 0xfffff8000b21b000 [init] 10 0 0 0 DL audit_wo 0xffffffff81714ce8 [audit] 0 0 0 0 DLs (threaded) [kernel] 100124 D - 0xffffffff814a1e24 [deadlkres] 100123 D - 0xfffff8001708c100 [mca taskq] 100108 D - 0xfffff8000c887700 [igb1 que] 100106 D - 0xfffff8000c887a00 [igb1 que] 100104 D - 0xfffff8000c887d00 [igb1 que] 100102 D - 0xfffff8000c888100 [igb1 que] 100100 D - 0xfffff8000c888400 [igb1 que] 100098 D - 0xfffff8000c888700 [igb1 que] 100096 D - 0xfffff8000c888a00 [igb1 que] 100094 D - 0xfffff8000c888d00 [igb1 que] 100091 D - 0xfffff8000c889200 [igb0 que] 100089 D - 0xfffff8000c889500 [igb0 que] 100087 D - 0xfffff8000c889800 [igb0 que] 100085 D - 0xfffff8000c889b00 [igb0 que] 100083 D - 0xfffff8000c889e00 [igb0 que] 100081 D - 0xfffff8000c88a200 [igb0 que] 100079 D - 0xfffff8000c88a500 [igb0 que] 100077 D - 0xfffff8000c7d3600 [igb0 que] 100067 D - 0xfffff8000b40d000 [ffs_trim taskq] 100066 D - 0xfffff8000b40d200 [thread taskq] 100063 D - 0xfffff8000b40da00 [acpi_task_2] 100062 D - 0xfffff8000b40da00 [acpi_task_1] 100061 D - 0xfffff8000b40da00 [acpi_task_0] 100060 D - 0xfffff8000b40dc00 [kqueue taskq] 100056 D - 0xfffff8000b20d300 [firmware taskq] 100000 D swapin 0xffffffff81705f18 [swapper] db:0:ps> allt Tracing command sh pid 2355 tid 100252 td 0xfffff80121d4c000 sched_switch() at sched_switch+0x482/frame 0xfffffe081e126610 mi_switch() at mi_switch+0x179/frame 0xfffffe081e126650 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e126690 sleepq_catch_signals() at sleepq_catch_signals+0x2f4/frame 0xfffffe081e126700 sleepq_wait_sig() at sleepq_wait_sig+0xf/frame 0xfffffe081e126730 _cv_wait_sig() at _cv_wait_sig+0x1e1/frame 0xfffffe081e1267a0 tty_wait() at tty_wait+0x42/frame 0xfffffe081e1267d0 ttydisc_read() at ttydisc_read+0x353/frame 0xfffffe081e126830 ttydev_read() at ttydev_read+0x6d/frame 0xfffffe081e126860 devfs_read_f() at devfs_read_f+0x7f/frame 0xfffffe081e1268c0 dofileread() at dofileread+0x7b/frame 0xfffffe081e126900 kern_readv() at kern_readv+0x65/frame 0xfffffe081e126950 sys_read() at sys_read+0x63/frame 0xfffffe081e1269a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081e126ab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081e126ab0 --- syscall (3, FreeBSD ELF64, sys_read), rip = 0x800de0a2a, rsp = 0x7fffffffdba8, rbp = 0x7fffffffdbd0 --- Tracing command ls pid 2104 tid 100264 td 0xfffff8025a889490 sched_switch() at sched_switch+0x482/frame 0xfffffe081e162610 mi_switch() at mi_switch+0x179/frame 0xfffffe081e162650 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e162690 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081e1626c0 _sleep() at _sleep+0x351/frame 0xfffffe081e162760 vn_start_write_locked() at vn_start_write_locked+0xa6/frame 0xfffffe081e1627b0 vn_close() at vn_close+0xca/frame 0xfffffe081e162820 vn_closefile() at vn_closefile+0x48/frame 0xfffffe081e1628a0 _fdrop() at _fdrop+0x29/frame 0xfffffe081e1628c0 closef() at closef+0x1d1/frame 0xfffffe081e162950 closefp() at closefp+0xa0/frame 0xfffffe081e1629a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081e162ab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081e162ab0 --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x800dac9ea, rsp = 0x7fffffffd408, rbp = 0x7fffffffd4c0 --- Tracing command netflix pid 2098 tid 100289 td 0xfffff802a8984920 sched_switch() at sched_switch+0x482/frame 0xfffffe081e1cb610 mi_switch() at mi_switch+0x179/frame 0xfffffe081e1cb650 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e1cb690 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081e1cb6c0 _sleep() at _sleep+0x351/frame 0xfffffe081e1cb760 vn_start_write_locked() at vn_start_write_locked+0xa6/frame 0xfffffe081e1cb7b0 vn_close() at vn_close+0xca/frame 0xfffffe081e1cb820 vn_closefile() at vn_closefile+0x48/frame 0xfffffe081e1cb8a0 _fdrop() at _fdrop+0x29/frame 0xfffffe081e1cb8c0 closef() at closef+0x1d1/frame 0xfffffe081e1cb950 closefp() at closefp+0xa0/frame 0xfffffe081e1cb9a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081e1cbab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081e1cbab0 --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8009499ea, rsp = 0x7fffffffd638, rbp = 0x7fffffffd700 --- Tracing command netflix pid 2096 tid 100217 td 0xfffff80121e7a000 sched_switch() at sched_switch+0x482/frame 0xfffffe081e077610 mi_switch() at mi_switch+0x179/frame 0xfffffe081e077650 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e077690 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081e0776c0 _sleep() at _sleep+0x351/frame 0xfffffe081e077760 vn_start_write_locked() at vn_start_write_locked+0xa6/frame 0xfffffe081e0777b0 vn_close() at vn_close+0xca/frame 0xfffffe081e077820 vn_closefile() at vn_closefile+0x48/frame 0xfffffe081e0778a0 _fdrop() at _fdrop+0x29/frame 0xfffffe081e0778c0 closef() at closef+0x1d1/frame 0xfffffe081e077950 closefp() at closefp+0xa0/frame 0xfffffe081e0779a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081e077ab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081e077ab0 --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8009499ea, rsp = 0x7fffffffd638, rbp = 0x7fffffffd700 --- Tracing command netflix pid 2094 tid 100274 td 0xfffff80163f48000 sched_switch() at sched_switch+0x482/frame 0xfffffe081e121610 mi_switch() at mi_switch+0x179/frame 0xfffffe081e121650 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e121690 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081e1216c0 _sleep() at _sleep+0x351/frame 0xfffffe081e121760 vn_start_write_locked() at vn_start_write_locked+0xa6/frame 0xfffffe081e1217b0 vn_close() at vn_close+0xca/frame 0xfffffe081e121820 vn_closefile() at vn_closefile+0x48/frame 0xfffffe081e1218a0 _fdrop() at _fdrop+0x29/frame 0xfffffe081e1218c0 closef() at closef+0x1d1/frame 0xfffffe081e121950 closefp() at closefp+0xa0/frame 0xfffffe081e1219a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081e121ab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081e121ab0 --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8009499ea, rsp = 0x7fffffffd638, rbp = 0x7fffffffd700 --- Tracing command netflix pid 2091 tid 100328 td 0xfffff802a8b44490 sched_switch() at sched_switch+0x482/frame 0xfffffe081e27c610 mi_switch() at mi_switch+0x179/frame 0xfffffe081e27c650 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e27c690 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081e27c6c0 _sleep() at _sleep+0x351/frame 0xfffffe081e27c760 vn_start_write_locked() at vn_start_write_locked+0xa6/frame 0xfffffe081e27c7b0 vn_close() at vn_close+0xca/frame 0xfffffe081e27c820 vn_closefile() at vn_closefile+0x48/frame 0xfffffe081e27c8a0 _fdrop() at _fdrop+0x29/frame 0xfffffe081e27c8c0 closef() at closef+0x1d1/frame 0xfffffe081e27c950 closefp() at closefp+0xa0/frame 0xfffffe081e27c9a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081e27cab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081e27cab0 --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8009499ea, rsp = 0x7fffffffd638, rbp = 0x7fffffffd700 --- Tracing command netflix pid 2090 tid 100327 td 0xfffff802cb197920 sched_switch() at sched_switch+0x482/frame 0xfffffe081e277610 mi_switch() at mi_switch+0x179/frame 0xfffffe081e277650 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e277690 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081e2776c0 _sleep() at _sleep+0x351/frame 0xfffffe081e277760 vn_start_write_locked() at vn_start_write_locked+0xa6/frame 0xfffffe081e2777b0 vn_close() at vn_close+0xca/frame 0xfffffe081e277820 vn_closefile() at vn_closefile+0x48/frame 0xfffffe081e2778a0 _fdrop() at _fdrop+0x29/frame 0xfffffe081e2778c0 closef() at closef+0x1d1/frame 0xfffffe081e277950 closefp() at closefp+0xa0/frame 0xfffffe081e2779a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081e277ab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081e277ab0 --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8009499ea, rsp = 0x7fffffffd638, rbp = 0x7fffffffd700 --- Tracing command netflix pid 2087 tid 100296 td 0xfffff8025a9c8490 sched_switch() at sched_switch+0x482/frame 0xfffffe081e1ee610 mi_switch() at mi_switch+0x179/frame 0xfffffe081e1ee650 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e1ee690 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081e1ee6c0 _sleep() at _sleep+0x351/frame 0xfffffe081e1ee760 vn_start_write_locked() at vn_start_write_locked+0xa6/frame 0xfffffe081e1ee7b0 vn_close() at vn_close+0xca/frame 0xfffffe081e1ee820 vn_closefile() at vn_closefile+0x48/frame 0xfffffe081e1ee8a0 _fdrop() at _fdrop+0x29/frame 0xfffffe081e1ee8c0 closef() at closef+0x1d1/frame 0xfffffe081e1ee950 closefp() at closefp+0xa0/frame 0xfffffe081e1ee9a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe081e1eeab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe081e1eeab0 --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8009499ea, rsp = 0x7fffffffd638, rbp = 0x7fffffffd700 --- Tracing command netflix pid 2085 tid 100315 td 0xfffff802a8bf4920 sched_switch() at sched_switch+0x482/frame 0xfffffe081e231260 mi_switch() at mi_switch+0x179/frame 0xfffffe081e2312a0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e2312e0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081e231310 _sleep() at _sleep+0x351/frame 0xfffffe081e2313b0 vn_start_write_locked() at vn_start_write_locked+0xa6/frame 0xfffffe081e231400 vn_close() at vn_close+0xca/frame 0xfffffe081e231470 vn_closefile() at vn_closefile+0x48/frame 0xfffffe081e2314f0 _fdrop() at _fdrop+0x29/frame 0xfffffe081e231510 closef() at closef+0x1d1/frame 0xfffffe081e2315a0 fdescfree() at fdescfree+0x3ca/frame 0xfffffe081e231650 exit1() at exit1+0x49d/frame 0xfffffe081e2316c0 sigexit() at sigexit+0xb7c/frame 0xfffffe081e231970 postsig() at postsig+0x399/frame 0xfffffe081e231a70 ast() at ast+0x337/frame 0xfffffe081e231ab0 doreti_ast() at doreti_ast+0x1f/frame 0x7fffffffd700 Tracing command md6 pid 2070 tid 100164 td 0xfffff80121e16000 sched_switch() at sched_switch+0x482/frame 0xfffffe081df608d0 mi_switch() at mi_switch+0x179/frame 0xfffffe081df60910 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081df60950 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081df60980 _sleep() at _sleep+0x351/frame 0xfffffe081df60a20 md_kthread() at md_kthread+0xd5/frame 0xfffffe081df60a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081df60ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081df60ab0 --- trap 0, rip = 0, rsp = 0xfffffe081df60b70, rbp = 0 --- Tracing command md5 pid 2057 tid 100297 td 0xfffff802a8faf920 sched_switch() at sched_switch+0x482/frame 0xfffffe081e1f38d0 mi_switch() at mi_switch+0x179/frame 0xfffffe081e1f3910 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e1f3950 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081e1f3980 _sleep() at _sleep+0x351/frame 0xfffffe081e1f3a20 md_kthread() at md_kthread+0xd5/frame 0xfffffe081e1f3a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081e1f3ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081e1f3ab0 --- trap 0, rip = 0, rsp = 0xfffffe081e1f3b70, rbp = 0 --- Tracing command softdepflush pid 70 tid 100321 td 0xfffff802a8b44920 sched_switch() at sched_switch+0x482/frame 0xfffffe081e2598b0 mi_switch() at mi_switch+0x179/frame 0xfffffe081e2598f0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e259930 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081e259960 _sleep() at _sleep+0x326/frame 0xfffffe081e259a00 softdep_flush() at softdep_flush+0x20c/frame 0xfffffe081e259a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081e259ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081e259ab0 --- trap 0, rip = 0, rsp = 0xfffffe081e259b70, rbp = 0 --- Tracing command softdepflush pid 70 tid 100320 td 0xfffff801632c1920 sched_switch() at sched_switch+0x482/frame 0xfffffe081e2548b0 mi_switch() at mi_switch+0x179/frame 0xfffffe081e2548f0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081e254930 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081e254960 _sleep() at _sleep+0x326/frame 0xfffffe081e254a00 softdep_flush() at softdep_flush+0x20c/frame 0xfffffe081e254a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081e254ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081e254ab0 --- trap 0, rip = 0, rsp = 0xfffffe081e254b70, rbp = 0 --- Tracing command softdepflush pid 70 tid 100149 td 0xfffff80121c58490 sched_switch() at sched_switch+0x482/frame 0xfffffe081df158b0 mi_switch() at mi_switch+0x179/frame 0xfffffe081df158f0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081df15930 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081df15960 _sleep() at _sleep+0x326/frame 0xfffffe081df15a00 softdep_flush() at softdep_flush+0x20c/frame 0xfffffe081df15a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081df15ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081df15ab0 --- trap 0, rip = 0, rsp = 0xfffffe081df15b70, rbp = 0 --- Tracing command softdepflush pid 70 tid 100148 td 0xfffff80121bdb920 sched_switch() at sched_switch+0x482/frame 0xfffffe081df108b0 mi_switch() at mi_switch+0x179/frame 0xfffffe081df108f0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081df10930 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081df10960 _sleep() at _sleep+0x326/frame 0xfffffe081df10a00 softdep_flush() at softdep_flush+0x20c/frame 0xfffffe081df10a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081df10ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081df10ab0 --- trap 0, rip = 0, rsp = 0xfffffe081df10b70, rbp = 0 --- Tracing command vnlru pid 16 tid 100133 td 0xfffff80121152000 sched_switch() at sched_switch+0x482/frame 0xfffffe081dbe98a0 mi_switch() at mi_switch+0x179/frame 0xfffffe081dbe98e0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081dbe9920 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081dbe9950 _sleep() at _sleep+0x326/frame 0xfffffe081dbe99f0 vnlru_proc() at vnlru_proc+0x48/frame 0xfffffe081dbe9a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081dbe9ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081dbe9ab0 --- trap 0, rip = 0, rsp = 0xfffffe081dbe9b70, rbp = 0 --- Tracing command syncer pid 9 tid 100132 td 0xfffff80121152490 sched_switch() at sched_switch+0x482/frame 0xfffffe081dbe48a0 mi_switch() at mi_switch+0x179/frame 0xfffffe081dbe48e0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081dbe4920 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081dbe4950 _cv_timedwait_sbt() at _cv_timedwait_sbt+0x1fd/frame 0xfffffe081dbe49d0 sched_sync() at sched_sync+0x5cb/frame 0xfffffe081dbe4a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081dbe4ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081dbe4ab0 --- trap 0, rip = 0, rsp = 0xfffffe081dbe4b70, rbp = 0 --- Tracing command bufdaemon pid 8 tid 100131 td 0xfffff80121152920 sched_switch() at sched_switch+0x482/frame 0xfffffe081dbdf8f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081dbdf930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081dbdf970 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081dbdf9a0 _sleep() at _sleep+0x326/frame 0xfffffe081dbdfa40 buf_daemon() at buf_daemon+0x68/frame 0xfffffe081dbdfa70 fork_exit() at fork_exit+0x84/frame 0xfffffe081dbdfab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081dbdfab0 --- trap 0, rip = 0, rsp = 0xfffffe081dbdfb70, rbp = 0 --- Tracing command pagezero pid 7 tid 100130 td 0xfffff80017015920 sched_switch() at sched_switch+0x482/frame 0xfffffe081dbda8f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081dbda930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081dbda970 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081dbda9a0 _sleep() at _sleep+0x326/frame 0xfffffe081dbdaa40 vm_pagezero() at vm_pagezero+0x88/frame 0xfffffe081dbdaa70 fork_exit() at fork_exit+0x84/frame 0xfffffe081dbdaab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081dbdaab0 --- trap 0, rip = 0, rsp = 0xfffffe081dbdab70, rbp = 0 --- Tracing command vmdaemon pid 6 tid 100129 td 0xfffff801210aa000 sched_switch() at sched_switch+0x482/frame 0xfffffe081dbd58b0 mi_switch() at mi_switch+0x179/frame 0xfffffe081dbd58f0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081dbd5930 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081dbd5960 _sleep() at _sleep+0x351/frame 0xfffffe081dbd5a00 vm_daemon() at vm_daemon+0x7e/frame 0xfffffe081dbd5a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081dbd5ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081dbd5ab0 --- trap 0, rip = 0, rsp = 0xfffffe081dbd5b70, rbp = 0 --- Tracing command pagedaemon pid 5 tid 100128 td 0xfffff801210aa490 sched_switch() at sched_switch+0x482/frame 0xfffffe081dbd08a0 mi_switch() at mi_switch+0x179/frame 0xfffffe081dbd08e0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081dbd0920 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081dbd0950 _sleep() at _sleep+0x326/frame 0xfffffe081dbd09f0 vm_pageout() at vm_pageout+0x237/frame 0xfffffe081dbd0a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081dbd0ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081dbd0ab0 --- trap 0, rip = 0, rsp = 0xfffffe081dbd0b70, rbp = 0 --- Tracing command enc_daemon0 pid 4 tid 100127 td 0xfffff801210aa920 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3e9ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3e9d00 trap() at trap+0x42/frame 0xfffffe07fc3e9f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3e9f20 --- trap 0x13, rip = 0xffffffff80cb9782, rsp = 0xfffffe07fc3e9fe0, rbp = 0xfffffe081dbcb790 --- smp_tlb_shootdown() at smp_tlb_shootdown+0x112/frame 0xfffffe081dbcb790 pmap_invalidate_range() at pmap_invalidate_range+0x33c/frame 0xfffffe081dbcb810 pmap_remove() at pmap_remove+0x446/frame 0xfffffe081dbcb8b0 kmem_unback() at kmem_unback+0x5f/frame 0xfffffe081dbcb8f0 kmem_free() at kmem_free+0x44/frame 0xfffffe081dbcb920 uma_large_free() at uma_large_free+0x36/frame 0xfffffe081dbcb940 free() at free+0x65/frame 0xfffffe081dbcb980 ses_cache_free() at ses_cache_free+0xc7/frame 0xfffffe081dbcb9c0 ses_publish_cache() at ses_publish_cache+0x3f/frame 0xfffffe081dbcba00 enc_daemon() at enc_daemon+0x2c0/frame 0xfffffe081dbcba70 fork_exit() at fork_exit+0x84/frame 0xfffffe081dbcbab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081dbcbab0 --- trap 0, rip = 0, rsp = 0xfffffe081dbcbb70, rbp = 0 --- Tracing command xpt_thrd pid 3 tid 100126 td 0xfffff801210ab000 sched_switch() at sched_switch+0x482/frame 0xfffffe081db468f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081db46930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081db46970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081db469a0 _sleep() at _sleep+0x351/frame 0xfffffe081db46a40 xpt_scanner_thread() at xpt_scanner_thread+0xdc/frame 0xfffffe081db46a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081db46ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081db46ab0 --- trap 0, rip = 0, rsp = 0xfffffe081db46b70, rbp = 0 --- Tracing command sctp_iterator pid 2 tid 100125 td 0xfffff80017011000 sched_switch() at sched_switch+0x482/frame 0xfffffe081db41900 mi_switch() at mi_switch+0x179/frame 0xfffffe081db41940 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081db41980 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081db419b0 _sleep() at _sleep+0x351/frame 0xfffffe081db41a50 sctp_iterator_thread() at sctp_iterator_thread+0x59/frame 0xfffffe081db41a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081db41ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081db41ab0 --- trap 0, rip = 0, rsp = 0xfffffe081db41b70, rbp = 0 --- Tracing command usb pid 15 tid 100119 td 0xfffff8000c8b6920 sched_switch() at sched_switch+0x482/frame 0xfffffe081ba9e920 mi_switch() at mi_switch+0x179/frame 0xfffffe081ba9e960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081ba9e9a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081ba9e9d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe081ba9ea40 usb_process() at usb_process+0xd4/frame 0xfffffe081ba9ea70 fork_exit() at fork_exit+0x84/frame 0xfffffe081ba9eab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081ba9eab0 --- trap 0, rip = 0, rsp = 0xfffffe081ba9eb70, rbp = 0 --- Tracing command usb pid 15 tid 100118 td 0xfffff8000c8c9000 sched_switch() at sched_switch+0x482/frame 0xfffffe081ba99920 mi_switch() at mi_switch+0x179/frame 0xfffffe081ba99960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081ba999a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081ba999d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe081ba99a40 usb_process() at usb_process+0xd4/frame 0xfffffe081ba99a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081ba99ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081ba99ab0 --- trap 0, rip = 0, rsp = 0xfffffe081ba99b70, rbp = 0 --- Tracing command usb pid 15 tid 100117 td 0xfffff8000c8c9490 sched_switch() at sched_switch+0x482/frame 0xfffffe081ba94920 mi_switch() at mi_switch+0x179/frame 0xfffffe081ba94960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081ba949a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081ba949d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe081ba94a40 usb_process() at usb_process+0xd4/frame 0xfffffe081ba94a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081ba94ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081ba94ab0 --- trap 0, rip = 0, rsp = 0xfffffe081ba94b70, rbp = 0 --- Tracing command usb pid 15 tid 100116 td 0xfffff8000c8c9920 sched_switch() at sched_switch+0x482/frame 0xfffffe081ba8f920 mi_switch() at mi_switch+0x179/frame 0xfffffe081ba8f960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081ba8f9a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081ba8f9d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe081ba8fa40 usb_process() at usb_process+0xd4/frame 0xfffffe081ba8fa70 fork_exit() at fork_exit+0x84/frame 0xfffffe081ba8fab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081ba8fab0 --- trap 0, rip = 0, rsp = 0xfffffe081ba8fb70, rbp = 0 --- Tracing command usb pid 15 tid 100114 td 0xfffff8000c8b5000 sched_switch() at sched_switch+0x482/frame 0xfffffe081b902920 mi_switch() at mi_switch+0x179/frame 0xfffffe081b902960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b9029a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b9029d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe081b902a40 usb_process() at usb_process+0xd4/frame 0xfffffe081b902a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b902ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b902ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b902b70, rbp = 0 --- Tracing command usb pid 15 tid 100113 td 0xfffff8000c8b5490 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8fd920 mi_switch() at mi_switch+0x179/frame 0xfffffe081b8fd960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b8fd9a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8fd9d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe081b8fda40 usb_process() at usb_process+0xd4/frame 0xfffffe081b8fda70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b8fdab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b8fdab0 --- trap 0, rip = 0, rsp = 0xfffffe081b8fdb70, rbp = 0 --- Tracing command usb pid 15 tid 100112 td 0xfffff8000c8b5920 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8f8920 mi_switch() at mi_switch+0x179/frame 0xfffffe081b8f8960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b8f89a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8f89d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe081b8f8a40 usb_process() at usb_process+0xd4/frame 0xfffffe081b8f8a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b8f8ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b8f8ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b8f8b70, rbp = 0 --- Tracing command usb pid 15 tid 100111 td 0xfffff8000c8b6000 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8f3920 mi_switch() at mi_switch+0x179/frame 0xfffffe081b8f3960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b8f39a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8f39d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe081b8f3a40 usb_process() at usb_process+0xd4/frame 0xfffffe081b8f3a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b8f3ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b8f3ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b8f3b70, rbp = 0 --- Tracing command usb pid 15 tid 100074 td 0xfffff8000b426920 sched_switch() at sched_switch+0x482/frame 0xfffffe000038e920 mi_switch() at mi_switch+0x179/frame 0xfffffe000038e960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe000038e9a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe000038e9d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe000038ea40 usb_process() at usb_process+0xd4/frame 0xfffffe000038ea70 fork_exit() at fork_exit+0x84/frame 0xfffffe000038eab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe000038eab0 --- trap 0, rip = 0, rsp = 0xfffffe000038eb70, rbp = 0 --- Tracing command usb pid 15 tid 100073 td 0xfffff8000c864000 sched_switch() at sched_switch+0x482/frame 0xfffffe0000389920 mi_switch() at mi_switch+0x179/frame 0xfffffe0000389960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe00003899a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe00003899d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe0000389a40 usb_process() at usb_process+0xd4/frame 0xfffffe0000389a70 fork_exit() at fork_exit+0x84/frame 0xfffffe0000389ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000389ab0 --- trap 0, rip = 0, rsp = 0xfffffe0000389b70, rbp = 0 --- Tracing command usb pid 15 tid 100072 td 0xfffff8000c864490 sched_switch() at sched_switch+0x482/frame 0xfffffe0000384920 mi_switch() at mi_switch+0x179/frame 0xfffffe0000384960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe00003849a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe00003849d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe0000384a40 usb_process() at usb_process+0xd4/frame 0xfffffe0000384a70 fork_exit() at fork_exit+0x84/frame 0xfffffe0000384ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000384ab0 --- trap 0, rip = 0, rsp = 0xfffffe0000384b70, rbp = 0 --- Tracing command usb pid 15 tid 100071 td 0xfffff8000c864920 sched_switch() at sched_switch+0x482/frame 0xfffffe000037f920 mi_switch() at mi_switch+0x179/frame 0xfffffe000037f960 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe000037f9a0 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe000037f9d0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe000037fa40 usb_process() at usb_process+0xd4/frame 0xfffffe000037fa70 fork_exit() at fork_exit+0x84/frame 0xfffffe000037fab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe000037fab0 --- trap 0, rip = 0, rsp = 0xfffffe000037fb70, rbp = 0 --- Tracing command rand_harvestq pid 14 tid 100057 td 0xfffff8000b27d490 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab498e0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab49920 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab49960 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe078ab49990 msleep_spin_sbt() at msleep_spin_sbt+0x1f0/frame 0xfffffe078ab49a20 random_kthread() at random_kthread+0x1b2/frame 0xfffffe078ab49a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab49ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab49ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab49b70, rbp = 0 --- Tracing command geom pid 13 tid 100055 td 0xfffff8000b265920 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab3f8c0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab3f900 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab3f940 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab3f970 _sleep() at _sleep+0x351/frame 0xfffffe078ab3fa10 g_io_schedule_down() at g_io_schedule_down+0x4c/frame 0xfffffe078ab3fa60 g_down_procbody() at g_down_procbody+0x7d/frame 0xfffffe078ab3fa70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab3fab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab3fab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab3fb70, rbp = 0 --- Tracing command geom pid 13 tid 100054 td 0xfffff8000b266000 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab3a8e0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab3a920 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab3a960 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab3a990 _sleep() at _sleep+0x351/frame 0xfffffe078ab3aa30 g_io_schedule_up() at g_io_schedule_up+0xbc/frame 0xfffffe078ab3aa60 g_up_procbody() at g_up_procbody+0x7d/frame 0xfffffe078ab3aa70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab3aab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab3aab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab3ab70, rbp = 0 --- Tracing command geom pid 13 tid 100053 td 0xfffff8000b266490 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab358e0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab35920 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab35960 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab35990 _sleep() at _sleep+0x351/frame 0xfffffe078ab35a30 g_run_events() at g_run_events+0x4f4/frame 0xfffffe078ab35a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab35ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab35ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab35b70, rbp = 0 --- Tracing command intr pid 12 tid 100122 td 0xfffff80017015000 sched_switch() at sched_switch+0x482/frame 0xfffffe081db2d9f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081db2da30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081db2da70 fork_exit() at fork_exit+0x84/frame 0xfffffe081db2dab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081db2dab0 --- trap 0, rip = 0, rsp = 0xfffffe081db2db70, rbp = 0 --- Tracing command intr pid 12 tid 100121 td 0xfffff80017015490 sched_switch() at sched_switch+0x482/frame 0xfffffe081db259f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081db25a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081db25a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081db25ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081db25ab0 --- trap 0, rip = 0, rsp = 0xfffffe081db25b70, rbp = 0 --- Tracing command intr pid 12 tid 100120 td 0xfffff8000c8b6490 sched_switch() at sched_switch+0x482/frame 0xfffffe081baa39f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081baa3a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081baa3a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081baa3ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081baa3ab0 --- trap 0, rip = 0, rsp = 0xfffffe081baa3b70, rbp = 0 --- Tracing command intr pid 12 tid 100115 td 0xfffff8000c8ab920 sched_switch() at sched_switch+0x482/frame 0xfffffe081ba8a9f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081ba8aa30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081ba8aa70 fork_exit() at fork_exit+0x84/frame 0xfffffe081ba8aab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081ba8aab0 --- trap 0, rip = 0, rsp = 0xfffffe081ba8ab70, rbp = 0 --- Tracing command intr pid 12 tid 100110 td 0xfffff8000c8aa000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100109 td 0xfffff8000c8aa490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100107 td 0xfffff8000c8ab000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100105 td 0xfffff8000c8a7490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100103 td 0xfffff8000c8a8000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100101 td 0xfffff8000c8a8920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100099 td 0xfffff8000c8a6000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100097 td 0xfffff8000c8a6920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100095 td 0xfffff8000c893000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100093 td 0xfffff8000c893920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100092 td 0xfffff8000c894000 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8369f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b836a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081b836a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b836ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b836ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b836b70, rbp = 0 --- Tracing command intr pid 12 tid 100090 td 0xfffff8000c88c490 sched_switch() at sched_switch+0x482/frame 0xfffffe081b82c9f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b82ca30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081b82ca70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b82cab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b82cab0 --- trap 0, rip = 0, rsp = 0xfffffe081b82cb70, rbp = 0 --- Tracing command intr pid 12 tid 100088 td 0xfffff8000c892000 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8229f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b822a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081b822a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b822ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b822ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b822b70, rbp = 0 --- Tracing command intr pid 12 tid 100086 td 0xfffff8000c892920 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8189f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b818a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081b818a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b818ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b818ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b818b70, rbp = 0 --- Tracing command intr pid 12 tid 100084 td 0xfffff8000c88b000 sched_switch() at sched_switch+0x482/frame 0xfffffe081b80e9f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b80ea30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081b80ea70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b80eab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b80eab0 --- trap 0, rip = 0, rsp = 0xfffffe081b80eb70, rbp = 0 --- Tracing command intr pid 12 tid 100082 td 0xfffff8000c88b920 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8049f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b804a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe081b804a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b804ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b804ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b804b70, rbp = 0 --- Tracing command intr pid 12 tid 100080 td 0xfffff8000c885000 sched_switch() at sched_switch+0x482/frame 0xfffffe00003f69f0 mi_switch() at mi_switch+0x179/frame 0xfffffe00003f6a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe00003f6a70 fork_exit() at fork_exit+0x84/frame 0xfffffe00003f6ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00003f6ab0 --- trap 0, rip = 0, rsp = 0xfffffe00003f6b70, rbp = 0 --- Tracing command intr pid 12 tid 100078 td 0xfffff8000c885920 sched_switch() at sched_switch+0x482/frame 0xfffffe00003ec9f0 mi_switch() at mi_switch+0x179/frame 0xfffffe00003eca30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe00003eca70 fork_exit() at fork_exit+0x84/frame 0xfffffe00003ecab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00003ecab0 --- trap 0, rip = 0, rsp = 0xfffffe00003ecb70, rbp = 0 --- Tracing command intr pid 12 tid 100076 td 0xfffff8000c886490 sched_switch() at sched_switch+0x482/frame 0xfffffe00003e29f0 mi_switch() at mi_switch+0x179/frame 0xfffffe00003e2a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe00003e2a70 fork_exit() at fork_exit+0x84/frame 0xfffffe00003e2ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00003e2ab0 --- trap 0, rip = 0, rsp = 0xfffffe00003e2b70, rbp = 0 --- Tracing command intr pid 12 tid 100075 td 0xfffff8000b426490 sched_switch() at sched_switch+0x482/frame 0xfffffe00003939f0 mi_switch() at mi_switch+0x179/frame 0xfffffe0000393a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe0000393a70 fork_exit() at fork_exit+0x84/frame 0xfffffe0000393ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000393ab0 --- trap 0, rip = 0, rsp = 0xfffffe0000393b70, rbp = 0 --- Tracing command intr pid 12 tid 100070 td 0xfffff8000b420920 sched_switch() at sched_switch+0x482/frame 0xfffffe000037a9f0 mi_switch() at mi_switch+0x179/frame 0xfffffe000037aa30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe000037aa70 fork_exit() at fork_exit+0x84/frame 0xfffffe000037aab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe000037aab0 --- trap 0, rip = 0, rsp = 0xfffffe000037ab70, rbp = 0 --- Tracing command intr pid 12 tid 100069 td 0xfffff8000b425000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100068 td 0xfffff8000b425490 sched_switch() at sched_switch+0x482/frame 0xfffffe0785dcf9f0 mi_switch() at mi_switch+0x179/frame 0xfffffe0785dcfa30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe0785dcfa70 fork_exit() at fork_exit+0x84/frame 0xfffffe0785dcfab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0785dcfab0 --- trap 0, rip = 0, rsp = 0xfffffe0785dcfb70, rbp = 0 --- Tracing command intr pid 12 tid 100065 td 0xfffff8000b418000 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab729f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab72a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe078ab72a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab72ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab72ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab72b70, rbp = 0 --- Tracing command intr pid 12 tid 100064 td 0xfffff8000b418490 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab6d9f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab6da30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe078ab6da70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab6dab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab6dab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab6db70, rbp = 0 --- Tracing command intr pid 12 tid 100059 td 0xfffff8000b267920 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab549f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab54a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe078ab54a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab54ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab54ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab54b70, rbp = 0 --- Tracing command intr pid 12 tid 100058 td 0xfffff8000b27d000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100052 td 0xfffff8000b266920 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab309f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab30a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe078ab30a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab30ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab30ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab30b70, rbp = 0 --- Tracing command intr pid 12 tid 100051 td 0xfffff8000b267000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100050 td 0xfffff8000b264000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100049 td 0xfffff8000b264490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100048 td 0xfffff8000b264920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100047 td 0xfffff8000b265000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100046 td 0xfffff8000b265490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100045 td 0xfffff8000b260490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100044 td 0xfffff8000b260920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100043 td 0xfffff8000b261000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100042 td 0xfffff8000b261490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100041 td 0xfffff8000b261920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100040 td 0xfffff8000b25c920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100039 td 0xfffff8000b25f000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100038 td 0xfffff8000b25f490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100037 td 0xfffff8000b25f920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100036 td 0xfffff8000b260000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100035 td 0xfffff8000b25b000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100034 td 0xfffff8000b25b490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100033 td 0xfffff8000b25b920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100032 td 0xfffff8000b25c000 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100031 td 0xfffff8000b25c490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100030 td 0xfffff8000b238490 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100029 td 0xfffff8000b238920 fork_trampoline() at fork_trampoline Tracing command intr pid 12 tid 100028 td 0xfffff8000b239000 sched_switch() at sched_switch+0x482/frame 0xfffffe078aab89f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078aab8a30 ithread_loop() at ithread_loop+0x1d2/frame 0xfffffe078aab8a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aab8ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aab8ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aab8b70, rbp = 0 --- Tracing command intr pid 12 tid 100027 td 0xfffff8000b239490 fork_trampoline() at fork_trampoline Tracing command idle pid 11 tid 100026 td 0xfffff8000b239920 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe078aa29ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe078aa29d00 trap() at trap+0x42/frame 0xfffffe078aa29f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe078aa29f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe078aa29fe0, rbp = 0xfffffe078aaae930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aaae930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aaae980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aaae9a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aaae9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aaaea70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aaaeab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aaaeab0 --- trap 0, rip = 0, rsp = 0xfffffe078aaaeb70, rbp = 0 --- Tracing command idle pid 11 tid 100025 td 0xfffff8000b234920 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3f9ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3f9d00 trap() at trap+0x42/frame 0xfffffe07fc3f9f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3f9f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3f9fe0, rbp = 0xfffffe078aaa9930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aaa9930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aaa9980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aaa99a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aaa99c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aaa9a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aaa9ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aaa9ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aaa9b70, rbp = 0 --- Tracing command idle pid 11 tid 100024 td 0xfffff8000b237000 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3f1ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3f1d00 trap() at trap+0x42/frame 0xfffffe07fc3f1f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3f1f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3f1fe0, rbp = 0xfffffe078aaa4930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aaa4930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aaa4980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aaa49a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aaa49c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aaa4a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aaa4ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aaa4ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aaa4b70, rbp = 0 --- Tracing command idle pid 11 tid 100023 td 0xfffff8000b237490 sched_switch() at sched_switch+0x482/frame 0xfffffe078aa9f960 mi_switch() at mi_switch+0x179/frame 0xfffffe078aa9f9a0 critical_exit() at critical_exit+0x8b/frame 0xfffffe078aa9f9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa9fa70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa9fab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa9fab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa9fb70, rbp = 0 --- Tracing command idle pid 11 tid 100022 td 0xfffff8000b237920 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3e1ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3e1d00 trap() at trap+0x42/frame 0xfffffe07fc3e1f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3e1f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3e1fe0, rbp = 0xfffffe078aa9a930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa9a930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa9a980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa9a9a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa9a9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa9aa70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa9aab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa9aab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa9ab70, rbp = 0 --- Tracing command idle pid 11 tid 100021 td 0xfffff8000b238000 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3d9ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3d9d00 trap() at trap+0x42/frame 0xfffffe07fc3d9f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3d9f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3d9fe0, rbp = 0xfffffe078aa95930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa95930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa95980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa959a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa959c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa95a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa95ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa95ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa95b70, rbp = 0 --- Tracing command idle pid 11 tid 100020 td 0xfffff8000b233000 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3d1ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3d1d00 trap() at trap+0x42/frame 0xfffffe07fc3d1f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3d1f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3d1fe0, rbp = 0xfffffe078aa90930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa90930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa90980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa909a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa909c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa90a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa90ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa90ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa90b70, rbp = 0 --- Tracing command idle pid 11 tid 100019 td 0xfffff8000b233490 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3c9ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3c9d00 trap() at trap+0x42/frame 0xfffffe07fc3c9f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3c9f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3c9fe0, rbp = 0xfffffe078aa8b930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa8b930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa8b980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa8b9a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa8b9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa8ba70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa8bab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa8bab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa8bb70, rbp = 0 --- Tracing command idle pid 11 tid 100018 td 0xfffff8000b233920 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3c1ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3c1d00 trap() at trap+0x42/frame 0xfffffe07fc3c1f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3c1f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3c1fe0, rbp = 0xfffffe078aa86930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa86930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa86980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa869a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa869c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa86a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa86ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa86ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa86b70, rbp = 0 --- Tracing command idle pid 11 tid 100017 td 0xfffff8000b234000 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3b9ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3b9d00 trap() at trap+0x42/frame 0xfffffe07fc3b9f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3b9f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3b9fe0, rbp = 0xfffffe078aa81930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa81930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa81980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa819a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa819c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa81a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa81ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa81ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa81b70, rbp = 0 --- Tracing command idle pid 11 tid 100016 td 0xfffff8000b234490 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3b1ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3b1d00 trap() at trap+0x42/frame 0xfffffe07fc3b1f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3b1f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3b1fe0, rbp = 0xfffffe078aa7c930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa7c930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa7c980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa7c9a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa7c9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa7ca70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa7cab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa7cab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa7cb70, rbp = 0 --- Tracing command idle pid 11 tid 100015 td 0xfffff8000b231490 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3a9ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3a9d00 trap() at trap+0x42/frame 0xfffffe07fc3a9f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3a9f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3a9fe0, rbp = 0xfffffe078aa77930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa77930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa77980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa779a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa779c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa77a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa77ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa77ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa77b70, rbp = 0 --- Tracing command idle pid 11 tid 100014 td 0xfffff8000b231920 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc3a1ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc3a1d00 trap() at trap+0x42/frame 0xfffffe07fc3a1f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc3a1f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc3a1fe0, rbp = 0xfffffe078aa72930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa72930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa72980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa729a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa729c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa72a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa72ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa72ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa72b70, rbp = 0 --- Tracing command idle pid 11 tid 100013 td 0xfffff8000b232000 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc399ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc399d00 trap() at trap+0x42/frame 0xfffffe07fc399f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc399f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc399fe0, rbp = 0xfffffe078aa6d930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa6d930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa6d980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa6d9a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa6d9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa6da70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa6dab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa6dab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa6db70, rbp = 0 --- Tracing command idle pid 11 tid 100012 td 0xfffff8000b232490 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc391ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc391d00 trap() at trap+0x42/frame 0xfffffe07fc391f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc391f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc391fe0, rbp = 0xfffffe078aa68930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa68930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa68980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa689a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa689c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa68a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa68ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa68ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa68b70, rbp = 0 --- Tracing command idle pid 11 tid 100011 td 0xfffff8000b232920 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc389ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc389d00 trap() at trap+0x42/frame 0xfffffe07fc389f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc389f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc389fe0, rbp = 0xfffffe078aa63930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa63930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa63980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa639a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa639c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa63a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa63ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa63ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa63b70, rbp = 0 --- Tracing command idle pid 11 tid 100010 td 0xfffff8000b222920 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc381ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc381d00 trap() at trap+0x42/frame 0xfffffe07fc381f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc381f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc381fe0, rbp = 0xfffffe078aa5e930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa5e930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa5e980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa5e9a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa5e9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa5ea70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa5eab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa5eab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa5eb70, rbp = 0 --- Tracing command idle pid 11 tid 100009 td 0xfffff8000b230000 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc379ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc379d00 trap() at trap+0x42/frame 0xfffffe07fc379f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc379f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc379fe0, rbp = 0xfffffe078aa59930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa59930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa59980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa599a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa599c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa59a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa59ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa59ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa59b70, rbp = 0 --- Tracing command idle pid 11 tid 100008 td 0xfffff8000b230490 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc371ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc371d00 trap() at trap+0x42/frame 0xfffffe07fc371f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc371f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc371fe0, rbp = 0xfffffe078aa54930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa54930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa54980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa549a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa549c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa54a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa54ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa54ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa54b70, rbp = 0 --- Tracing command idle pid 11 tid 100007 td 0xfffff8000b230920 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc369ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc369d00 trap() at trap+0x42/frame 0xfffffe07fc369f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc369f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc369fe0, rbp = 0xfffffe078aa4f930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa4f930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa4f980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa4f9a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa4f9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa4fa70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa4fab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa4fab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa4fb70, rbp = 0 --- Tracing command idle pid 11 tid 100006 td 0xfffff8000b231000 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc361ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc361d00 trap() at trap+0x42/frame 0xfffffe07fc361f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc361f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc361fe0, rbp = 0xfffffe078aa4a930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa4a930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa4a980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa4a9a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa4a9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa4aa70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa4aab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa4aab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa4ab70, rbp = 0 --- Tracing command idle pid 11 tid 100005 td 0xfffff8000b21c000 cpustop_handler() at cpustop_handler+0x28/frame 0xfffffe07fc359ce0 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xfffffe07fc359d00 trap() at trap+0x42/frame 0xfffffe07fc359f20 nmi_calltrap() at nmi_calltrap+0x8/frame 0xfffffe07fc359f20 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xfffffe07fc359fe0, rbp = 0xfffffe078aa45930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa45930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa45980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa459a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa459c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa45a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa45ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa45ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa45b70, rbp = 0 --- Tracing command idle pid 11 tid 100004 td 0xfffff8000b21c490 kdb_alt_break_internal() at kdb_alt_break_internal+0x17f/frame 0xfffffe078aa40730 kdb_alt_break() at kdb_alt_break+0xb/frame 0xfffffe078aa40740 uart_intr_rxready() at uart_intr_rxready+0x96/frame 0xfffffe078aa40770 uart_intr() at uart_intr+0x111/frame 0xfffffe078aa407b0 intr_event_handle() at intr_event_handle+0x8c/frame 0xfffffe078aa40800 intr_execute_handlers() at intr_execute_handlers+0x48/frame 0xfffffe078aa40830 lapic_handle_intr() at lapic_handle_intr+0x73/frame 0xfffffe078aa40860 Xapic_isr1() at Xapic_isr1+0xa4/frame 0xfffffe078aa40860 --- interrupt, rip = 0xffffffff80caab36, rsp = 0xfffffe078aa40920, rbp = 0xfffffe078aa40930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa40930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa40980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa409a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa409c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa40a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa40ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa40ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa40b70, rbp = 0 --- Tracing command idle pid 11 tid 100003 td 0xfffff8000b21c920 cpustop_handler() at cpustop_handler+0x28/frame 0xffffffff8169ec00 ipi_nmi_handler() at ipi_nmi_handler+0x3f/frame 0xffffffff8169ec20 trap() at trap+0x42/frame 0xffffffff8169ee40 nmi_calltrap() at nmi_calltrap+0x8/frame 0xffffffff8169ee40 --- trap 0x13, rip = 0xffffffff80caab36, rsp = 0xffffffff8169ef00, rbp = 0xfffffe078aa3b930 --- acpi_cpu_c1() at acpi_cpu_c1+0x6/frame 0xfffffe078aa3b930 acpi_cpu_idle() at acpi_cpu_idle+0x13b/frame 0xfffffe078aa3b980 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe078aa3b9a0 cpu_idle() at cpu_idle+0x93/frame 0xfffffe078aa3b9c0 sched_idletd() at sched_idletd+0x1e8/frame 0xfffffe078aa3ba70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa3bab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa3bab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa3bb70, rbp = 0 --- Tracing command init pid 1 tid 100002 td 0xfffff8000b222000 sched_switch() at sched_switch+0x482/frame 0xfffffe078aa36550 mi_switch() at mi_switch+0x179/frame 0xfffffe078aa36590 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078aa365d0 sleepq_catch_signals() at sleepq_catch_signals+0x2f4/frame 0xfffffe078aa36640 sleepq_wait_sig() at sleepq_wait_sig+0xf/frame 0xfffffe078aa36670 _sleep() at _sleep+0x334/frame 0xfffffe078aa36710 kern_wait6() at kern_wait6+0x3e7/frame 0xfffffe078aa367b0 sys_wait4() at sys_wait4+0x76/frame 0xfffffe078aa369a0 amd64_syscall() at amd64_syscall+0x282/frame 0xfffffe078aa36ab0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe078aa36ab0 --- syscall (7, FreeBSD ELF64, sys_wait4), rip = 0x41323a, rsp = 0x7fffffffd6d8, rbp = 0x7fffffffd7c0 --- Tracing command audit pid 10 tid 100001 td 0xfffff8000b222490 sched_switch() at sched_switch+0x482/frame 0xfffffe078aa318f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078aa31930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078aa31970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078aa319a0 _cv_wait() at _cv_wait+0x1dc/frame 0xfffffe078aa31a10 audit_worker() at audit_worker+0xa3/frame 0xfffffe078aa31a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078aa31ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078aa31ab0 --- trap 0, rip = 0, rsp = 0xfffffe078aa31b70, rbp = 0 --- Tracing command kernel pid 0 tid 100124 td 0xfffff80017011490 sched_switch() at sched_switch+0x482/frame 0xfffffe081db3b880 mi_switch() at mi_switch+0x179/frame 0xfffffe081db3b8c0 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081db3b900 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xfffffe081db3b930 _sleep() at _sleep+0x326/frame 0xfffffe081db3b9d0 pause_sbt() at pause_sbt+0xe4/frame 0xfffffe081db3ba20 deadlkres() at deadlkres+0x66/frame 0xfffffe081db3ba70 fork_exit() at fork_exit+0x84/frame 0xfffffe081db3bab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081db3bab0 --- trap 0, rip = 0, rsp = 0xfffffe081db3bb70, rbp = 0 --- Tracing command kernel pid 0 tid 100123 td 0xfffff80017011920 sched_switch() at sched_switch+0x482/frame 0xfffffe081db36900 mi_switch() at mi_switch+0x179/frame 0xfffffe081db36940 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081db36980 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081db369b0 msleep_spin_sbt() at msleep_spin_sbt+0x200/frame 0xfffffe081db36a40 taskqueue_thread_loop() at taskqueue_thread_loop+0x8d/frame 0xfffffe081db36a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081db36ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081db36ab0 --- trap 0, rip = 0, rsp = 0xfffffe081db36b70, rbp = 0 --- Tracing command kernel pid 0 tid 100108 td 0xfffff8000c8aa920 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8c28f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b8c2930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b8c2970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8c29a0 _sleep() at _sleep+0x351/frame 0xfffffe081b8c2a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b8c2a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b8c2ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b8c2ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b8c2b70, rbp = 0 --- Tracing command kernel pid 0 tid 100106 td 0xfffff8000c8ab490 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8b88f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b8b8930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b8b8970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8b89a0 _sleep() at _sleep+0x351/frame 0xfffffe081b8b8a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b8b8a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b8b8ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b8b8ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b8b8b70, rbp = 0 --- Tracing command kernel pid 0 tid 100104 td 0xfffff8000c8a7920 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8ae8f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b8ae930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b8ae970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8ae9a0 _sleep() at _sleep+0x351/frame 0xfffffe081b8aea40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b8aea70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b8aeab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b8aeab0 --- trap 0, rip = 0, rsp = 0xfffffe081b8aeb70, rbp = 0 --- Tracing command kernel pid 0 tid 100102 td 0xfffff8000c8a8490 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8a48f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b8a4930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b8a4970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8a49a0 _sleep() at _sleep+0x351/frame 0xfffffe081b8a4a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b8a4a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b8a4ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b8a4ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b8a4b70, rbp = 0 --- Tracing command kernel pid 0 tid 100100 td 0xfffff8000c894920 sched_switch() at sched_switch+0x482/frame 0xfffffe081b89a8f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b89a930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b89a970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b89a9a0 _sleep() at _sleep+0x351/frame 0xfffffe081b89aa40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b89aa70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b89aab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b89aab0 --- trap 0, rip = 0, rsp = 0xfffffe081b89ab70, rbp = 0 --- Tracing command kernel pid 0 tid 100098 td 0xfffff8000c8a6490 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8908f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b890930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b890970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8909a0 _sleep() at _sleep+0x351/frame 0xfffffe081b890a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b890a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b890ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b890ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b890b70, rbp = 0 --- Tracing command kernel pid 0 tid 100096 td 0xfffff8000c8a7000 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8868f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b886930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b886970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8869a0 _sleep() at _sleep+0x351/frame 0xfffffe081b886a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b886a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b886ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b886ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b886b70, rbp = 0 --- Tracing command kernel pid 0 tid 100094 td 0xfffff8000c893490 sched_switch() at sched_switch+0x482/frame 0xfffffe081b87c8f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b87c930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b87c970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b87c9a0 _sleep() at _sleep+0x351/frame 0xfffffe081b87ca40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b87ca70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b87cab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b87cab0 --- trap 0, rip = 0, rsp = 0xfffffe081b87cb70, rbp = 0 --- Tracing command kernel pid 0 tid 100091 td 0xfffff8000c894490 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8318f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b831930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b831970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8319a0 _sleep() at _sleep+0x351/frame 0xfffffe081b831a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b831a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b831ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b831ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b831b70, rbp = 0 --- Tracing command kernel pid 0 tid 100089 td 0xfffff8000c88c920 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8278f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b827930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b827970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8279a0 _sleep() at _sleep+0x351/frame 0xfffffe081b827a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b827a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b827ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b827ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b827b70, rbp = 0 --- Tracing command kernel pid 0 tid 100087 td 0xfffff8000c892490 sched_switch() at sched_switch+0x482/frame 0xfffffe081b81d8f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b81d930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b81d970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b81d9a0 _sleep() at _sleep+0x351/frame 0xfffffe081b81da40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b81da70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b81dab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b81dab0 --- trap 0, rip = 0, rsp = 0xfffffe081b81db70, rbp = 0 --- Tracing command kernel pid 0 tid 100085 td 0xfffff8000c886920 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8138f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b813930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b813970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8139a0 _sleep() at _sleep+0x351/frame 0xfffffe081b813a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b813a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b813ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b813ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b813b70, rbp = 0 --- Tracing command kernel pid 0 tid 100083 td 0xfffff8000c88b490 sched_switch() at sched_switch+0x482/frame 0xfffffe081b8098f0 mi_switch() at mi_switch+0x179/frame 0xfffffe081b809930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe081b809970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe081b8099a0 _sleep() at _sleep+0x351/frame 0xfffffe081b809a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe081b809a70 fork_exit() at fork_exit+0x84/frame 0xfffffe081b809ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe081b809ab0 --- trap 0, rip = 0, rsp = 0xfffffe081b809b70, rbp = 0 --- Tracing command kernel pid 0 tid 100081 td 0xfffff8000c88c000 sched_switch() at sched_switch+0x482/frame 0xfffffe00003fb8f0 mi_switch() at mi_switch+0x179/frame 0xfffffe00003fb930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe00003fb970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe00003fb9a0 _sleep() at _sleep+0x351/frame 0xfffffe00003fba40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe00003fba70 fork_exit() at fork_exit+0x84/frame 0xfffffe00003fbab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00003fbab0 --- trap 0, rip = 0, rsp = 0xfffffe00003fbb70, rbp = 0 --- Tracing command kernel pid 0 tid 100079 td 0xfffff8000c885490 sched_switch() at sched_switch+0x482/frame 0xfffffe00003f18f0 mi_switch() at mi_switch+0x179/frame 0xfffffe00003f1930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe00003f1970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe00003f19a0 _sleep() at _sleep+0x351/frame 0xfffffe00003f1a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe00003f1a70 fork_exit() at fork_exit+0x84/frame 0xfffffe00003f1ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00003f1ab0 --- trap 0, rip = 0, rsp = 0xfffffe00003f1b70, rbp = 0 --- Tracing command kernel pid 0 tid 100077 td 0xfffff8000c886000 sched_switch() at sched_switch+0x482/frame 0xfffffe00003e78f0 mi_switch() at mi_switch+0x179/frame 0xfffffe00003e7930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe00003e7970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe00003e79a0 _sleep() at _sleep+0x351/frame 0xfffffe00003e7a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe00003e7a70 fork_exit() at fork_exit+0x84/frame 0xfffffe00003e7ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00003e7ab0 --- trap 0, rip = 0, rsp = 0xfffffe00003e7b70, rbp = 0 --- Tracing command kernel pid 0 tid 100067 td 0xfffff8000b425920 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab7c8f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab7c930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab7c970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab7c9a0 _sleep() at _sleep+0x351/frame 0xfffffe078ab7ca40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe078ab7ca70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab7cab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab7cab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab7cb70, rbp = 0 --- Tracing command kernel pid 0 tid 100066 td 0xfffff8000b426000 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab778f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab77930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab77970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab779a0 _sleep() at _sleep+0x351/frame 0xfffffe078ab77a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe078ab77a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab77ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab77ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab77b70, rbp = 0 --- Tracing command kernel pid 0 tid 100063 td 0xfffff8000b418920 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab68900 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab68940 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab68980 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab689b0 msleep_spin_sbt() at msleep_spin_sbt+0x200/frame 0xfffffe078ab68a40 taskqueue_thread_loop() at taskqueue_thread_loop+0x8d/frame 0xfffffe078ab68a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab68ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab68ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab68b70, rbp = 0 --- Tracing command kernel pid 0 tid 100062 td 0xfffff8000b420000 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab63900 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab63940 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab63980 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab639b0 msleep_spin_sbt() at msleep_spin_sbt+0x200/frame 0xfffffe078ab63a40 taskqueue_thread_loop() at taskqueue_thread_loop+0x8d/frame 0xfffffe078ab63a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab63ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab63ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab63b70, rbp = 0 --- Tracing command kernel pid 0 tid 100061 td 0xfffff8000b420490 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab5e900 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab5e940 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab5e980 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab5e9b0 msleep_spin_sbt() at msleep_spin_sbt+0x200/frame 0xfffffe078ab5ea40 taskqueue_thread_loop() at taskqueue_thread_loop+0x8d/frame 0xfffffe078ab5ea70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab5eab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab5eab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab5eb70, rbp = 0 --- Tracing command kernel pid 0 tid 100060 td 0xfffff8000b267490 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab598f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab59930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab59970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab599a0 _sleep() at _sleep+0x351/frame 0xfffffe078ab59a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe078ab59a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab59ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab59ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab59b70, rbp = 0 --- Tracing command kernel pid 0 tid 100056 td 0xfffff8000b27d920 sched_switch() at sched_switch+0x482/frame 0xfffffe078ab448f0 mi_switch() at mi_switch+0x179/frame 0xfffffe078ab44930 sleepq_switch() at sleepq_switch+0x185/frame 0xfffffe078ab44970 sleepq_wait() at sleepq_wait+0x43/frame 0xfffffe078ab449a0 _sleep() at _sleep+0x351/frame 0xfffffe078ab44a40 taskqueue_thread_loop() at taskqueue_thread_loop+0xc8/frame 0xfffffe078ab44a70 fork_exit() at fork_exit+0x84/frame 0xfffffe078ab44ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe078ab44ab0 --- trap 0, rip = 0, rsp = 0xfffffe078ab44b70, rbp = 0 --- Tracing command kernel pid 0 tid 100000 td 0xffffffff817063e0 sched_switch() at sched_switch+0x482/frame 0xffffffff81a209d0 mi_switch() at mi_switch+0x179/frame 0xffffffff81a20a10 sleepq_switch() at sleepq_switch+0x185/frame 0xffffffff81a20a50 sleepq_timedwait() at sleepq_timedwait+0x43/frame 0xffffffff81a20a80 _sleep() at _sleep+0x326/frame 0xffffffff81a20b20 swapper() at swapper+0x211/frame 0xffffffff81a20b70 btext() at btext+0x2c db:0:allt> call doadump Dumping 1972 out of 31643 MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91% Dump complete = 0 db:0:doadump> reset cpu_reset: Restarting BSP cpu_reset_proxy: Stopped CPU 1 (kgdb) proc 2104 [Switching to thread 148 (Thread 100264)]#0 sched_switch (td=0xfffff8025a889490, newtd=, flags=) at ../../../kern/sched_ule.c:1962 1962 cpuid = PCPU_GET(cpuid); Current language: auto; currently minimal (kgdb) bt #0 sched_switch (td=0xfffff8025a889490, newtd=, flags=) at ../../../kern/sched_ule.c:1962 #1 0xffffffff808c3389 in mi_switch (flags=0x104, newtd=0x0) at ../../../kern/kern_synch.c:494 #2 0xffffffff808fe6c5 in sleepq_switch (wchan=, pri=) at ../../../kern/subr_sleepqueue.c:541 #3 0xffffffff808fe4f3 in sleepq_wait (wchan=0xfffff802a89ee098, pri=0x77) at ../../../kern/subr_sleepqueue.c:620 #4 0xffffffff808c2ca1 in _sleep (ident=, lock=, priority=0x77, wmesg=0xffffffff80f42196 "suspfs", sbt=0x0, pr=0x0) at ../../../kern/kern_synch.c:256 #5 0xffffffff809731a6 in vn_start_write_locked (mp=0xfffff802a89ee000, flags=0x1) at ../../../kern/vfs_vnops.c:1506 #6 0xffffffff8097251a in vn_close (vp=0xfffff802755d0750, flags=0x5, file_cred=0xfffff80121575300, td=0xfffff8025a889490) at ../../../kern/vfs_vnops.c:1558 #7 0xffffffff80971418 in vn_closefile (fp=0xfffff80121817870, td=0xfffff8025a889490) at ../../../kern/vfs_vnops.c:1469 #8 0xffffffff808774d9 in _fdrop (fp=0xfffff80121817870, td=0x0) at file.h:342 #9 0xffffffff80879dc1 in closef (fp=0xfffff80121817870, td=0xfffff8025a889490) at ../../../kern/kern_descrip.c:2289 #10 0xffffffff80877aa0 in closefp (fdp=0xfffff80121fc8800, fd=, fp=0xfffff80121817870, td=0xfffff8025a889490, holdleaders=) at ../../../kern/kern_descrip.c:1147 #11 0xffffffff80ccb132 in amd64_syscall (td=0xfffff8025a889490, traced=0x0) at subr_syscall.c:134 #12 0xffffffff80cafd1b in Xfast_syscall () at ../../../amd64/amd64/exception.S:391 #13 0x0000000800dac9ea in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) f 5 #5 0xffffffff809731a6 in vn_start_write_locked (mp=0xfffff802a89ee000, flags=0x1) at ../../../kern/vfs_vnops.c:1506 1506 error = msleep(&mp->mnt_flag, MNT_MTX(mp), (kgdb) p *mp $1 = {mnt_mtx = {lock_object = {lo_name = 0xffffffff80f19115 "struct mount mtx", lo_flags = 0x1030000, lo_data = 0x0, lo_witness = 0xfffffe00006d1b00}, mtx_lock = 0x4}, mnt_gen = 0x1, mnt_list = {tqe_next = 0xfffff8012148f790, tqe_prev = 0xfffff80121c677b8}, mnt_op = 0xffffffff8143e770, mnt_vfc = 0xffffffff8143e890, mnt_vnodecovered = 0xfffff80121789000, mnt_syncer = 0xfffff80277fa39c0, mnt_ref = 0x7493, mnt_nvnodelist = {tqh_first = 0xfffff802755d0750, tqh_last = 0xfffff802880e5c50}, mnt_nvnodelistsize = 0x7491, mnt_activevnodelist = {tqh_first = 0xfffff8027744e000, tqh_last = 0xfffff802755d08a8}, mnt_activevnodelistsize = 0x1b62, mnt_writeopcount = 0x0, mnt_kern_flag = 0x48802144, mnt_flag = 0x100001300, mnt_opt = 0xfffff80163531800, mnt_optnew = 0x0, mnt_maxsymlinklen = 0x78, mnt_stat = {f_version = 0x20030518, f_type = 0x35, f_flags = 0x100001300, f_bsize = 0x1000, f_iosize = 0x8000, f_blocks = 0x7bfa5, f_bfree = 0x791ff, f_bavail = 0x6f34e, f_files = 0x3fffe, f_ffree = 0x2ee1d, f_syncwrites = 0xfcaf, f_asyncwrites = 0x19608, f_syncreads = 0xd, f_asyncreads = 0x0, f_spare = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, f_namemax = 0xff, f_owner = 0x0, f_fsid = {val = { 0x5253d8b4, 0xcd6c0e7c}}, f_charspare = '\0' , f_fstypename = "ufs", '\0' , f_mntfromname = "/dev/md5a", '\0' , f_mntonname = "/mnt", '\0' }, mnt_cred = 0xfffff80163277200, mnt_data = 0xfffff80163772c00, mnt_time = 0x0, mnt_iosize_max = 0x20000, mnt_export = 0xfffff8012117ea00, mnt_label = 0x0, mnt_hashseed = 0xa97e6cc3, mnt_lockref = 0x0, mnt_secondary_writes = 0x0, mnt_secondary_accwrites = 0x1883dc, mnt_susp_owner = 0xfffff801632c1920, mnt_gjprovider = 0x0, mnt_explock = {lock_object = {lo_name = 0xffffffff80f19126 "explock", lo_flags = 0x6730000, lo_data = 0x0, lo_witness = 0xfffffe00006ea700}, lk_lock = 0x1, lk_exslpfail = 0x0, lk_timo = 0x0, lk_pri = 0x60, lk_stack = {depth = 0x6, pcs = {0xffffffff8089d717, 0xffffffff80953b0a, 0xffffffff8095a1de, 0xffffffff80958e22, 0xffffffff80ccb132, 0xffffffff80cafd1b, 0x0 }}}, mnt_upper_link = {tqe_next = 0x0, tqe_prev = 0x0}, mnt_uppers = { tqh_first = 0x0, tqh_last = 0xfffff802a89ee3b8}} (kgdb) p mp->mnt_kern_flag $2 = 0x48802144 #define MNTK_LOOKUP_SHARED 0x40000000 #define MNTK_SUSPEND 0x08000000 #define MNTK_NOASYNC 0x00800000 #define MNTK_UNMAPPED_BUFS 0x00002000 #define MNTK_NO_IOPF 0x00000100 #define MNTK_EXTENDED_SHARED 0x00000040 #define MNTK_SOFTDEP 0x00000004 (kgdb) p mp->mnt_susp_owner $3 = (struct thread *) 0xfffff801632c1920 (kgdb) thread 137 [Switching to thread 137 (Thread 100320)]#0 sched_switch (td=0xfffff801632c1920, newtd=, flags=) at ../../../kern/sched_ule.c:1962 1962 cpuid = PCPU_GET(cpuid); (kgdb) bt #0 sched_switch (td=0xfffff801632c1920, newtd=, flags=) at ../../../kern/sched_ule.c:1962 #1 0xffffffff808c3389 in mi_switch (flags=0x104, newtd=0x0) at ../../../kern/kern_synch.c:494 #2 0xffffffff808fe6c5 in sleepq_switch (wchan=, pri=) at ../../../kern/subr_sleepqueue.c:541 #3 0xffffffff808febe3 in sleepq_timedwait (wchan=0xffffffff81699050, pri=0x54) at ../../../kern/subr_sleepqueue.c:655 #4 0xffffffff808c2c76 in _sleep (ident=, lock=, priority=0x54, wmesg=0xffffffff80f6c213 "sdflush", sbt=, pr=0x0) at ../../../kern/kern_synch.c:252 #5 0xffffffff80af3d0c in softdep_flush (addr=0xfffff802a89ee000) at ../../../ufs/ffs/ffs_softdep.c:1406 #6 0xffffffff80889374 in fork_exit (callout=0xffffffff80af3b00 , arg=0xfffff802a89ee000, frame=0xfffffe081e254ac0) at ../../../kern/kern_fork.c:995 #7 0xffffffff80caff6e in fork_trampoline () at ../../../amd64/amd64/exception.S:606 #8 0x0000000000000000 in ?? () (kgdb) f 5 #5 0xffffffff80af3d0c in softdep_flush (addr=0xfffff802a89ee000) at ../../../ufs/ffs/ffs_softdep.c:1406 1406 msleep(&req_pending, &lk, PVM, "sdflush", hz / 2); (kgdb) l 1401 while (ump->softdep_on_worklist > 0 && 1402 softdep_process_worklist(mp, 0) > 0) 1403 kthread_suspend_check(); 1404 ACQUIRE_GBLLOCK(&lk); 1405 if (req_pending != ALLCLEAN && req_pending != mp) 1406 msleep(&req_pending, &lk, PVM, "sdflush", hz / 2); 1407 req_pending = NULL; 1408 FREE_GBLLOCK(&lk); 1409 /* 1410 * Check to see if we are done and need to exit. (kgdb) info loc mp = (struct mount *) 0xfffff802a89ee000 td = (struct thread *) 0xfffff801632c1920 ump = (struct ufsmount *) 0xfffff80163772c00 (kgdb) p req_pending $4 = (struct mount *) 0x0 (kgdb) p *ump $5 = {um_mountp = 0xfffff802a89ee000, um_dev = 0xfffff80121370800, um_cp = 0xfffff801211f6880, um_bo = 0xfffff80284ea08b8, um_devvp = 0xfffff80284ea0750, um_fstype = 0x2, um_fs = 0xfffff80163a89000, um_extattr = {uepm_lock = {lock_object = {lo_name = 0xffffffff80f6d988 "ufs_extattr_sx", lo_flags = 0x2330000, lo_data = 0x0, lo_witness = 0xfffffe00006ec200}, sx_lock = 0x1}, uepm_list = {lh_first = 0x0}, uepm_ucred = 0x0, uepm_flags = 0x1}, um_nindir = 0x1000, um_bptrtodb = 0x3, um_seqinc = 0x8, um_lock = {lock_object = {lo_name = 0xffffffff80f6cc44 "FFS", lo_flags = 0x1030000, lo_data = 0x0, lo_witness = 0xfffffe00006ec180}, mtx_lock = 0x4}, um_fsckpid = 0x0, um_softdep = 0xfffff802a4512400, um_quotas = {0x0, 0x0}, um_cred = {0x0, 0x0}, um_btime = {0x0, 0x0}, um_itime = {0x0, 0x0}, um_qflags = "\000", um_savedmaxfilesize = 0x0, um_candelete = 0x0, um_writesuspended = 0x0, um_balloc = 0xffffffff80ae6e70 , um_blkatoff = 0xffffffff80b195f0 , um_truncate = 0xffffffff80ae8e60 , um_update = 0xffffffff80ae8ad0 , um_valloc = 0xffffffff80ae1d50 , um_vfree = 0xffffffff80ae2bc0 , um_ifree = 0xffffffff80b204a0 , um_rdonly = 0xffffffff80aea830 , um_snapgone = 0xffffffff80aee0b0 } (kgdb) p *ump->um_softdep $3 = {sd_fslock = {lock_object = {lo_name = 0xffffffff80f690d6 "Per-Filesystem Softdep Lock", lo_flags = 0x5230000, lo_data = 0x0, lo_witness = 0xfffffe00006ec380}, rw_lock = 0x1}, sd_workitem_pending = {lh_first = 0x0}, sd_worklist_tail = 0xfffff802a4512420, sd_journal_pending = {lh_first = 0x0}, sd_journal_tail = 0xfffff802a4512430, sd_jblocks = 0xfffff80121edf080, sd_unlinked = {tqh_first = 0x0, tqh_last = 0xfffff802a4512448}, sd_dirtycg = {lh_first = 0x0}, sd_mkdirlisthd = {lh_first = 0x0}, sd_pdhash = 0xfffffe0004f27000, sd_pdhashsize = 0xffff, sd_pdnextclean = 0x0, sd_idhash = 0xfffffe0004fa7000, sd_idhashsize = 0x7ffff, sd_idnextclean = 0x0, sd_newblkhash = 0xfffffe00053a7000, sd_newblkhashsize = 0xfffff, sd_bmhash = 0xfffffe0004f11000, sd_bmhashsize = 0x3ff, sd_indirhash = 0xfffff80163346950, sd_indirhashsize = 0x0, sd_numindirdeps = 0x0, sd_on_journal = 0x0, sd_on_worklist = 0x0, sd_deps = 0x2428, sd_accdeps = 0x446d69, sd_req = 0x0, sd_flags = 0x0, sd_flushtd = 0xfffff801632c1920} (kgdb) $ svn diff -x -p /usr/src/sys Index: /usr/src/sys/ufs/ffs/ffs_extern.h =================================================================== --- /usr/src/sys/ufs/ffs/ffs_extern.h (revision 256095) +++ /usr/src/sys/ufs/ffs/ffs_extern.h (working copy) @@ -152,9 +152,7 @@ void softdep_setup_sbupdate(struct ufsmount *, str void softdep_fsync_mountdev(struct vnode *); int softdep_sync_metadata(struct vnode *); int softdep_sync_buf(struct vnode *, struct buf *, int); -int softdep_process_worklist(struct mount *, int); int softdep_fsync(struct vnode *); -int softdep_waitidle(struct mount *); int softdep_prealloc(struct vnode *, int); int softdep_journal_lookup(struct mount *, struct vnode **); void softdep_journal_freeblocks(struct inode *, struct ucred *, off_t, int); Index: /usr/src/sys/ufs/ffs/ffs_softdep.c =================================================================== --- /usr/src/sys/ufs/ffs/ffs_softdep.c (revision 256095) +++ /usr/src/sys/ufs/ffs/ffs_softdep.c (working copy) @@ -138,6 +138,7 @@ softdep_unmount(mp) struct mount *mp; { + panic("softdep_unmount called"); } void @@ -146,6 +147,8 @@ softdep_setup_sbupdate(ump, fs, bp) struct fs *fs; struct buf *bp; { + + panic("softdep_setup_sbupdate called"); } void @@ -433,8 +436,6 @@ softdep_prealloc(vp, waitok) { panic("%s called", __FUNCTION__); - - return (0); } int @@ -503,7 +504,7 @@ int softdep_sync_metadata(struct vnode *vp) { - return (0); + panic("softdep_sync_metadata called"); } int @@ -510,7 +511,7 @@ int softdep_sync_buf(struct vnode *vp, struct buf *bp, int waitfor) { - return (0); + panic("softdep_sync_buf called"); } int @@ -521,14 +522,6 @@ softdep_slowdown(vp) panic("softdep_slowdown called"); } -void -softdep_releasefile(ip) - struct inode *ip; /* inode with the zero effective link count */ -{ - - panic("softdep_releasefile called"); -} - int softdep_request_cleanup(fs, vp, cred, resource) struct fs *fs; @@ -720,6 +713,7 @@ static MALLOC_DEFINE(M_SENTINEL, "sentinel", "Work static MALLOC_DEFINE(M_SAVEDINO, "savedino", "Saved inodes"); static MALLOC_DEFINE(M_JBLOCKS, "jblocks", "Journal block locations"); +static MALLOC_DEFINE(M_MOUNTDATA, "softdep", "Softdep per-mount data"); /* * translate from workitem type to memory type @@ -756,8 +750,6 @@ static struct malloc_type *memtype[] = { M_SENTINEL }; -static LIST_HEAD(mkdirlist, mkdir) mkdirlisthd; - #define DtoM(type) (memtype[type]) /* @@ -773,49 +765,15 @@ static struct malloc_type *memtype[] = { #define DOT_OFFSET offsetof(struct dirtemplate, dot_ino) /* - * Forward declarations. - */ -struct inodedep_hashhead; -struct newblk_hashhead; -struct pagedep_hashhead; -struct bmsafemap_hashhead; - -/* - * Private journaling structures. - */ -struct jblocks { - struct jseglst jb_segs; /* TAILQ of current segments. */ - struct jseg *jb_writeseg; /* Next write to complete. */ - struct jseg *jb_oldestseg; /* Oldest segment with valid entries. */ - struct jextent *jb_extent; /* Extent array. */ - uint64_t jb_nextseq; /* Next sequence number. */ - uint64_t jb_oldestwrseq; /* Oldest written sequence number. */ - uint8_t jb_needseg; /* Need a forced segment. */ - uint8_t jb_suspended; /* Did journal suspend writes? */ - int jb_avail; /* Available extents. */ - int jb_used; /* Last used extent. */ - int jb_head; /* Allocator head. */ - int jb_off; /* Allocator extent offset. */ - int jb_blocks; /* Total disk blocks covered. */ - int jb_free; /* Total disk blocks free. */ - int jb_min; /* Minimum free space. */ - int jb_low; /* Low on space. */ - int jb_age; /* Insertion time of oldest rec. */ -}; - -struct jextent { - ufs2_daddr_t je_daddr; /* Disk block address. */ - int je_blocks; /* Disk block count. */ -}; - -/* * Internal function prototypes. */ +static int softdep_waitidle(struct mount *); +static int softdep_process_worklist(struct mount *, int); static void softdep_error(char *, int); static void drain_output(struct vnode *); static struct buf *getdirtybuf(struct buf *, struct rwlock *, int); -static void clear_remove(void); -static void clear_inodedeps(void); +static void clear_remove(struct mount *); +static void clear_inodedeps(struct mount *); static void unlinked_inodedep(struct mount *, struct inodedep *); static void clear_unlinked_inodedep(struct inodedep *); static struct inodedep *first_unlinked_inodedep(struct ufsmount *); @@ -926,7 +884,7 @@ static inline void setup_freeindir(struct freeblks static inline struct freeblks *newfreeblks(struct mount *, struct inode *); static void freeblks_free(struct ufsmount *, struct freeblks *, int); static void indir_trunc(struct freework *, ufs2_daddr_t, ufs_lbn_t); -ufs2_daddr_t blkcount(struct fs *, ufs2_daddr_t, off_t); +static ufs2_daddr_t blkcount(struct fs *, ufs2_daddr_t, off_t); static int trunc_check_buf(struct buf *, int *, ufs_lbn_t, int, int); static void trunc_dependencies(struct inode *, struct freeblks *, ufs_lbn_t, int, int); @@ -959,20 +917,20 @@ static void allocdirect_merge(struct allocdirectls struct allocdirect *, struct allocdirect *); static struct freefrag *allocindir_merge(struct allocindir *, struct allocindir *); -static int bmsafemap_find(struct bmsafemap_hashhead *, struct mount *, int, +static int bmsafemap_find(struct bmsafemap_hashhead *, int, struct bmsafemap **); static struct bmsafemap *bmsafemap_lookup(struct mount *, struct buf *, int cg, struct bmsafemap *); -static int newblk_find(struct newblk_hashhead *, struct mount *, ufs2_daddr_t, - int, struct newblk **); +static int newblk_find(struct newblk_hashhead *, ufs2_daddr_t, int, + struct newblk **); static int newblk_lookup(struct mount *, ufs2_daddr_t, int, struct newblk **); -static int inodedep_find(struct inodedep_hashhead *, struct fs *, ino_t, +static int inodedep_find(struct inodedep_hashhead *, ino_t, struct inodedep **); static int inodedep_lookup(struct mount *, ino_t, int, struct inodedep **); static int pagedep_lookup(struct mount *, struct buf *bp, ino_t, ufs_lbn_t, int, struct pagedep **); static int pagedep_find(struct pagedep_hashhead *, ino_t, ufs_lbn_t, - struct mount *mp, int, struct pagedep **); + struct pagedep **); static void pause_timer(void *); static int request_cleanup(struct mount *, int); static int process_worklist_item(struct mount *, int, int); @@ -984,12 +942,12 @@ static void add_to_worklist(struct worklist *, int static void wake_worklist(struct worklist *); static void wait_worklist(struct worklist *, char *); static void remove_from_worklist(struct worklist *); -static void softdep_flush(void); +static void softdep_flush(void *); static void softdep_flushjournal(struct mount *); static int softdep_speedup(void); -static void worklist_speedup(void); +static void worklist_speedup(struct mount *); static int journal_mount(struct mount *, struct fs *, struct ucred *); -static void journal_unmount(struct mount *); +static void journal_unmount(struct ufsmount *); static int journal_space(struct ufsmount *, int); static void journal_suspend(struct ufsmount *); static int journal_unsuspend(struct ufsmount *ump); @@ -1035,16 +993,29 @@ static void softdep_disk_write_complete(struct buf static void softdep_deallocate_dependencies(struct buf *); static int softdep_count_dependencies(struct buf *bp, int); -static struct rwlock lk; -RW_SYSINIT(softdep_lock, &lk, "Softdep Lock"); +/* + * Global lock over all of soft updates. + */ +static struct mtx lk; +MTX_SYSINIT(softdep_lock, &lk, "Global Softdep Lock", MTX_DEF); -#define TRY_ACQUIRE_LOCK(lk) rw_try_wlock(lk) -#define ACQUIRE_LOCK(lk) rw_wlock(lk) -#define FREE_LOCK(lk) rw_wunlock(lk) +#define ACQUIRE_GBLLOCK(lk) mtx_lock(lk) +#define FREE_GBLLOCK(lk) mtx_unlock(lk) +#define GBLLOCK_OWNED(lk) mtx_assert((lk), MA_OWNED) -#define BUF_AREC(bp) lockallowrecurse(&(bp)->b_lock) -#define BUF_NOREC(bp) lockdisablerecurse(&(bp)->b_lock) +/* + * Per filesystem soft updates locking. + */ +#define LOCK_PTR(ump) (&(ump)->um_softdep->sd_fslock) +#define TRY_ACQUIRE_LOCK(ump) rw_try_wlock(&(ump)->um_softdep->sd_fslock) +#define ACQUIRE_LOCK(ump) rw_wlock(&(ump)->um_softdep->sd_fslock) +#define FREE_LOCK(ump) rw_wunlock(&(ump)->um_softdep->sd_fslock) +#define LOCK_OWNED(ump) rw_assert(&(ump)->um_softdep->sd_fslock, \ + RA_WLOCKED) +#define BUF_AREC(bp) lockallowrecurse(&(bp)->b_lock) +#define BUF_NOREC(bp) lockdisablerecurse(&(bp)->b_lock) + /* * Worklist queue management. * These routines require that the lock be held. @@ -1078,7 +1049,7 @@ worklist_insert(head, item, locked) { if (locked) - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(VFSTOUFS(item->wk_mp)); if (item->wk_state & ONWORKLIST) panic("worklist_insert: %p %s(0x%X) already on list", item, TYPENAME(item->wk_type), item->wk_state); @@ -1093,7 +1064,7 @@ worklist_remove(item, locked) { if (locked) - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(VFSTOUFS(item->wk_mp)); if ((item->wk_state & ONWORKLIST) == 0) panic("worklist_remove: %p %s(0x%X) not on list", item, TYPENAME(item->wk_type), item->wk_state); @@ -1166,7 +1137,6 @@ jwork_move(dst, src) freedep = freedep_merge(WK_FREEDEP(wk), freedep); } - rw_assert(&lk, RA_WLOCKED); while ((wk = LIST_FIRST(src)) != NULL) { WORKLIST_REMOVE(wk); WORKLIST_INSERT(dst, wk); @@ -1221,7 +1191,6 @@ workitem_free(item, type) int type; { struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); #ifdef DEBUG if (item->wk_state & ONWORKLIST) @@ -1234,6 +1203,7 @@ workitem_free(item, type) if (item->wk_state & IOWAITING) wakeup(item); ump = VFSTOUFS(item->wk_mp); + LOCK_OWNED(ump); KASSERT(ump->softdep_deps > 0, ("workitem_free: %s: softdep_deps going negative", ump->um_fs->fs_fsmnt)); @@ -1242,7 +1212,7 @@ workitem_free(item, type) KASSERT(dep_current[item->wk_type] > 0, ("workitem_free: %s: dep_current[%s] going negative", ump->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); - dep_current[item->wk_type]--; + atomic_subtract_long(&dep_current[item->wk_type], 1); free(item, DtoM(type)); } @@ -1259,14 +1229,14 @@ workitem_alloc(item, type, mp) item->wk_state = 0; ump = VFSTOUFS(mp); - ACQUIRE_LOCK(&lk); - dep_current[type]++; + atomic_add_long(&dep_current[type], 1); if (dep_current[type] > dep_highuse[type]) dep_highuse[type] = dep_current[type]; - dep_total[type]++; + atomic_add_long(&dep_total[type], 1); + ACQUIRE_LOCK(ump); ump->softdep_deps++; ump->softdep_accdeps++; - FREE_LOCK(&lk); + FREE_LOCK(ump); } static void @@ -1278,11 +1248,11 @@ workitem_reassign(item, newtype) KASSERT(dep_current[item->wk_type] > 0, ("workitem_reassign: %s: dep_current[%s] going negative", VFSTOUFS(item->wk_mp)->um_fs->fs_fsmnt, TYPENAME(item->wk_type))); - dep_current[item->wk_type]--; - dep_current[newtype]++; + atomic_subtract_long(&dep_current[item->wk_type], 1); + atomic_add_long(&dep_current[newtype], 1); if (dep_current[newtype] > dep_highuse[newtype]) dep_highuse[newtype] = dep_current[newtype]; - dep_total[newtype]++; + atomic_add_long(&dep_total[newtype], 1); item->wk_type = newtype; } @@ -1295,7 +1265,8 @@ static int tickdelay = 2; /* number of ticks to pa static int proc_waiting; /* tracks whether we have a timeout posted */ static int *stat_countp; /* statistic to count in proc_waiting timeout */ static struct callout softdep_callout; -static int req_pending; +static struct mount *req_pending; +#define ALLCLEAN ((struct mount *)-1) static int req_clear_inodedeps; /* syncer process flush some inodedeps */ static int req_clear_remove; /* syncer process flush some freeblks */ static int softdep_flushcache = 0; /* Should we do BIO_FLUSH? */ @@ -1303,6 +1274,7 @@ static int softdep_flushcache = 0; /* Should we do /* * runtime statistics */ +static int stat_flush_threads; /* number of softdep flushing threads */ static int stat_worklist_push; /* number of worklist cleanups */ static int stat_blk_limit_push; /* number of times block limit neared */ static int stat_ino_limit_push; /* number of times inode limit neared */ @@ -1334,6 +1306,8 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, tickdelay, CT &tickdelay, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, maxindirdeps, CTLFLAG_RW, &maxindirdeps, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, flush_threads, CTLFLAG_RD, + &stat_flush_threads, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, worklist_push, CTLFLAG_RW, &stat_worklist_push, 0,""); SYSCTL_INT(_debug_softdep, OID_AUTO, blk_limit_push, CTLFLAG_RW, @@ -1387,86 +1361,89 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, flushcache, C SYSCTL_DECL(_vfs_ffs); -LIST_HEAD(bmsafemap_hashhead, bmsafemap) *bmsafemap_hashtbl; -static u_long bmsafemap_hash; /* size of hash table - 1 */ - -static int compute_summary_at_mount = 0; /* Whether to recompute the summary at mount time */ +/* Whether to recompute the summary at mount time */ +static int compute_summary_at_mount = 0; SYSCTL_INT(_vfs_ffs, OID_AUTO, compute_summary_at_mount, CTLFLAG_RW, &compute_summary_at_mount, 0, "Recompute summary at mount"); +/* + * This function cleans the worklist for a filesystem. + * Each filesystem running with soft dependencies gets its own + * thread to run in this function. The thread is started up in + * softdep_mount and shutdown in softdep_unmount. They show up + * as part of the kernel "softdepflush" process whose process + * entry is saved in softdepproc. + */ static struct proc *softdepproc; -static struct kproc_desc softdep_kp = { - "softdepflush", - softdep_flush, - &softdepproc -}; -SYSINIT(sdproc, SI_SUB_KTHREAD_UPDATE, SI_ORDER_ANY, kproc_start, - &softdep_kp); - static void -softdep_flush(void) +softdep_flush(addr) + void *addr; { - struct mount *nmp; struct mount *mp; + struct thread *td; struct ufsmount *ump; - struct thread *td; - int remaining; - int progress; td = curthread; td->td_pflags |= TDP_NORUNNINGBUF; - + mp = (struct mount *)addr; + ump = VFSTOUFS(mp); + KASSERT(ump->softdep_flushtd == td, + ("Mismatch curthread %p != softdep_flushtd %p\n", td, + ump->softdep_flushtd)); + atomic_add_int(&stat_flush_threads, 1); +#ifdef DEBUG + if (stat_flush_threads == 1) + printf("Running %s at pid %d\n", softdepproc->p_comm, + softdepproc->p_pid); + printf("Start thread %s\n", td->td_name); +#endif for (;;) { - kproc_suspend_check(softdepproc); - ACQUIRE_LOCK(&lk); + while (ump->softdep_on_worklist > 0 && + softdep_process_worklist(mp, 0) > 0) + kthread_suspend_check(); + ACQUIRE_GBLLOCK(&lk); + if (req_pending != ALLCLEAN && req_pending != mp) + msleep(&req_pending, &lk, PVM, "sdflush", hz / 2); + req_pending = NULL; + FREE_GBLLOCK(&lk); /* - * If requested, try removing inode or removal dependencies. + * Check to see if we are done and need to exit. */ - if (req_clear_inodedeps) { - clear_inodedeps(); - req_clear_inodedeps -= 1; - wakeup_one(&proc_waiting); + ACQUIRE_LOCK(ump); + if ((ump->softdep_flags & FLUSH_EXIT) == 0) { + FREE_LOCK(ump); + continue; } - if (req_clear_remove) { - clear_remove(); - req_clear_remove -= 1; - wakeup_one(&proc_waiting); - } - FREE_LOCK(&lk); - remaining = progress = 0; - mtx_lock(&mountlist_mtx); - for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { - nmp = TAILQ_NEXT(mp, mnt_list); - if (MOUNTEDSOFTDEP(mp) == 0) - continue; - if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) - continue; - progress += softdep_process_worklist(mp, 0); - ump = VFSTOUFS(mp); - remaining += ump->softdep_on_worklist; - mtx_lock(&mountlist_mtx); - nmp = TAILQ_NEXT(mp, mnt_list); - vfs_unbusy(mp); - } - mtx_unlock(&mountlist_mtx); - if (remaining && progress) - continue; - ACQUIRE_LOCK(&lk); - if (!req_pending) - msleep(&req_pending, &lk, PVM, "sdflush", hz); - req_pending = 0; - FREE_LOCK(&lk); + ump->softdep_flags &= ~FLUSH_EXIT; + wakeup(&ump->softdep_flags); + FREE_LOCK(ump); +#ifdef DEBUG + printf("Stop thread %s\n", td->td_name); +#endif + /* + * If we are the last thread exiting, then the softdep + * flushing process will exit, so the next mount needs + * to create it again. If a new one is started before + * we exit, two softdepflush processes will exist which + * will cause no harm. + */ + if (atomic_fetchadd_int(&stat_flush_threads, -1) == 1) + softdepproc = NULL; + kthread_exit(); + panic("kthread_exit failed\n"); } } static void -worklist_speedup(void) +worklist_speedup(mp) + struct mount *mp; { - rw_assert(&lk, RA_WLOCKED); + ACQUIRE_GBLLOCK(&lk); if (req_pending == 0) { - req_pending = 1; + req_pending = mp; wakeup(&req_pending); } + FREE_GBLLOCK(&lk); } static int @@ -1473,9 +1450,9 @@ static int softdep_speedup(void) { - worklist_speedup(); + worklist_speedup(ALLCLEAN); bd_speedup(); - return speedup_syncer(); + return (speedup_syncer()); } /* @@ -1496,8 +1473,8 @@ add_to_worklist(wk, flags) { struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); + LOCK_OWNED(ump); if (wk->wk_state & ONWORKLIST) panic("add_to_worklist: %s(0x%X) already on list", TYPENAME(wk->wk_type), wk->wk_state); @@ -1513,7 +1490,7 @@ add_to_worklist(wk, flags) } ump->softdep_on_worklist += 1; if (flags & WK_NODELAY) - worklist_speedup(); + worklist_speedup(wk->wk_mp); } /* @@ -1549,9 +1526,11 @@ wait_worklist(wk, wmesg) struct worklist *wk; char *wmesg; { + struct ufsmount *ump; + ump = VFSTOUFS(wk->wk_mp); wk->wk_state |= IOWAITING; - msleep(wk, &lk, PVM, wmesg, 0); + msleep(wk, LOCK_PTR(ump), PVM, wmesg, 0); } /* @@ -1563,7 +1542,7 @@ wait_worklist(wk, wmesg) * ordering ensures that no new triples will be generated * until all the old ones have been purged from the dependency lists. */ -int +static int softdep_process_worklist(mp, full) struct mount *mp; int full; @@ -1573,15 +1552,13 @@ softdep_process_worklist(mp, full) long starttime; KASSERT(mp != NULL, ("softdep_process_worklist: NULL mp")); - /* - * Record the process identifier of our caller so that we can give - * this process preferential treatment in request_cleanup below. - */ + if (MOUNTEDSOFTDEP(mp) == 0) + return (0); matchcnt = 0; ump = VFSTOUFS(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); starttime = time_second; - softdep_process_journal(mp, NULL, full?MNT_WAIT:0); + softdep_process_journal(mp, NULL, full ? MNT_WAIT : 0); while (ump->softdep_on_worklist > 0) { if ((cnt = process_worklist_item(mp, 10, LK_NOWAIT)) == 0) break; @@ -1590,30 +1567,36 @@ softdep_process_worklist(mp, full) /* * If requested, try removing inode or removal dependencies. */ + ACQUIRE_GBLLOCK(&lk); if (req_clear_inodedeps) { - clear_inodedeps(); req_clear_inodedeps -= 1; + FREE_GBLLOCK(&lk); + clear_inodedeps(mp); + ACQUIRE_GBLLOCK(&lk); wakeup_one(&proc_waiting); } if (req_clear_remove) { - clear_remove(); req_clear_remove -= 1; + FREE_GBLLOCK(&lk); + clear_remove(mp); + ACQUIRE_GBLLOCK(&lk); wakeup_one(&proc_waiting); } + FREE_GBLLOCK(&lk); /* * We do not generally want to stop for buffer space, but if * we are really being a buffer hog, we will stop and wait. */ if (should_yield()) { - FREE_LOCK(&lk); + FREE_LOCK(ump); kern_yield(PRI_USER); bwillwrite(); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } /* * Never allow processing to run for more than one - * second. Otherwise the other mountpoints may get - * excessively backlogged. + * second. This gives the syncer thread the opportunity + * to pause if appropriate. */ if (!full && starttime != time_second) break; @@ -1620,7 +1603,7 @@ softdep_process_worklist(mp, full) } if (full == 0) journal_unsuspend(ump); - FREE_LOCK(&lk); + FREE_LOCK(ump); return (matchcnt); } @@ -1635,12 +1618,13 @@ process_removes(vp) { struct inodedep *inodedep; struct dirrem *dirrem; + struct ufsmount *ump; struct mount *mp; ino_t inum; - rw_assert(&lk, RA_WLOCKED); - mp = vp->v_mount; + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); inum = VTOI(vp)->i_number; for (;;) { top: @@ -1663,12 +1647,12 @@ top: if (dirrem == NULL) return; remove_from_worklist(&dirrem->dm_list); - FREE_LOCK(&lk); + FREE_LOCK(ump); if (vn_start_secondary_write(NULL, &mp, V_NOWAIT)) panic("process_removes: suspended filesystem"); handle_workitem_remove(dirrem, 0); vn_finished_secondary_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } } @@ -1684,13 +1668,14 @@ process_truncates(vp) { struct inodedep *inodedep; struct freeblks *freeblks; + struct ufsmount *ump; struct mount *mp; ino_t inum; int cgwait; - rw_assert(&lk, RA_WLOCKED); - mp = vp->v_mount; + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); inum = VTOI(vp)->i_number; for (;;) { if (inodedep_lookup(mp, inum, 0, &inodedep) == 0) @@ -1711,9 +1696,9 @@ process_truncates(vp) } /* Freeblks is waiting on a inode write. */ if ((freeblks->fb_state & COMPLETE) == 0) { - FREE_LOCK(&lk); + FREE_LOCK(ump); ffs_update(vp, 1); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); break; } if ((freeblks->fb_state & (ALLCOMPLETE | ONWORKLIST)) == @@ -1720,7 +1705,7 @@ process_truncates(vp) (ALLCOMPLETE | ONWORKLIST)) { remove_from_worklist(&freeblks->fb_list); freeblks->fb_state |= INPROGRESS; - FREE_LOCK(&lk); + FREE_LOCK(ump); if (vn_start_secondary_write(NULL, &mp, V_NOWAIT)) panic("process_truncates: " @@ -1727,7 +1712,7 @@ process_truncates(vp) "suspended filesystem"); handle_workitem_freeblocks(freeblks, 0); vn_finished_secondary_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); break; } if (freeblks->fb_cgwait) @@ -1734,10 +1719,10 @@ process_truncates(vp) cgwait++; } if (cgwait) { - FREE_LOCK(&lk); + FREE_LOCK(ump); sync_cgs(mp, MNT_WAIT); ffs_sync_snap(mp, MNT_WAIT); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); continue; } if (freeblks == NULL) @@ -1761,7 +1746,6 @@ process_worklist_item(mp, target, flags) int matchcnt; int error; - rw_assert(&lk, RA_WLOCKED); KASSERT(mp != NULL, ("process_worklist_item: NULL mp")); /* * If we are being called because of a process doing a @@ -1772,6 +1756,7 @@ process_worklist_item(mp, target, flags) return (-1); PHOLD(curproc); /* Don't let the stack go away. */ ump = VFSTOUFS(mp); + LOCK_OWNED(ump); matchcnt = 0; sentinel.wk_mp = NULL; sentinel.wk_type = D_SENTINEL; @@ -1788,7 +1773,7 @@ process_worklist_item(mp, target, flags) wk); wk->wk_state |= INPROGRESS; remove_from_worklist(wk); - FREE_LOCK(&lk); + FREE_LOCK(ump); if (vn_start_secondary_write(NULL, &mp, V_NOWAIT)) panic("process_worklist_item: suspended filesystem"); switch (wk->wk_type) { @@ -1821,7 +1806,7 @@ process_worklist_item(mp, target, flags) /* NOTREACHED */ } vn_finished_secondary_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (error == 0) { if (++matchcnt == target) break; @@ -1855,11 +1840,17 @@ softdep_move_dependencies(oldbp, newbp) struct buf *newbp; { struct worklist *wk, *wktail; + struct ufsmount *ump; int dirty; + if ((wk = LIST_FIRST(&oldbp->b_dep)) == NULL) + return (0); + KASSERT(MOUNTEDSOFTDEP(wk->wk_mp) != 0, + ("softdep_move_dependencies called on non-softdep filesystem")); dirty = 0; wktail = NULL; - ACQUIRE_LOCK(&lk); + ump = VFSTOUFS(wk->wk_mp); + ACQUIRE_LOCK(ump); while ((wk = LIST_FIRST(&oldbp->b_dep)) != NULL) { LIST_REMOVE(wk, wk_list); if (wk->wk_type == D_BMSAFEMAP && @@ -1871,7 +1862,7 @@ softdep_move_dependencies(oldbp, newbp) LIST_INSERT_AFTER(wktail, wk, wk_list); wktail = wk; } - FREE_LOCK(&lk); + FREE_LOCK(ump); return (dirty); } @@ -1909,7 +1900,7 @@ softdep_flushworklist(oldmnt, countp, td) return (error); } -int +static int softdep_waitidle(struct mount *mp) { struct ufsmount *ump; @@ -1917,15 +1908,15 @@ softdep_waitidle(struct mount *mp) int i; ump = VFSTOUFS(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); for (i = 0; i < 10 && ump->softdep_deps; i++) { ump->softdep_req = 1; if (ump->softdep_on_worklist) panic("softdep_waitidle: work added after flush."); - msleep(&ump->softdep_deps, &lk, PVM, "softdeps", 1); + msleep(&ump->softdep_deps, LOCK_PTR(ump), PVM, "softdeps", 1); } ump->softdep_req = 0; - FREE_LOCK(&lk); + FREE_LOCK(ump); error = 0; if (i == 10) { error = EBUSY; @@ -1952,6 +1943,8 @@ softdep_flushfiles(oldmnt, flags, td) int error, early, depcount, loopcnt, retry_flush_count, retry; int morework; + KASSERT(MOUNTEDSOFTDEP(oldmnt) != 0, + ("softdep_flushfiles called on non-softdep filesystem")); loopcnt = 10; retry_flush_count = 3; retry_flush: @@ -2022,12 +2015,14 @@ retry_flush: /* * Structure hashing. * - * There are three types of structures that can be looked up: + * There are four types of structures that can be looked up: * 1) pagedep structures identified by mount point, inode number, * and logical block. * 2) inodedep structures identified by mount point and inode number. * 3) newblk structures identified by mount point and * physical block number. + * 4) bmsafemap structures identified by mount point and + * cylinder group number. * * The "pagedep" and "inodedep" dependency structures are hashed * separately from the file blocks and inodes to which they correspond. @@ -2039,7 +2034,8 @@ retry_flush: * their allocdirect or allocindir structure. * * The lookup routines optionally create and hash a new instance when - * an existing entry is not found. + * an existing entry is not found. The bmsafemap lookup routine always + * allocates a new structure if an existing one is not found. */ #define DEPALLOC 0x0001 /* allocate structure if lookup fails */ #define NODELAY 0x0002 /* cannot do background work */ @@ -2047,26 +2043,20 @@ retry_flush: /* * Structures and routines associated with pagedep caching. */ -LIST_HEAD(pagedep_hashhead, pagedep) *pagedep_hashtbl; -u_long pagedep_hash; /* size of hash table - 1 */ -#define PAGEDEP_HASH(mp, inum, lbn) \ - (&pagedep_hashtbl[((((register_t)(mp)) >> 13) + (inum) + (lbn)) & \ - pagedep_hash]) +#define PAGEDEP_HASH(ump, inum, lbn) \ + (&(ump)->pagedep_hashtbl[((inum) + (lbn)) & (ump)->pagedep_hash_size]) static int -pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp) +pagedep_find(pagedephd, ino, lbn, pagedeppp) struct pagedep_hashhead *pagedephd; ino_t ino; ufs_lbn_t lbn; - struct mount *mp; - int flags; struct pagedep **pagedeppp; { struct pagedep *pagedep; LIST_FOREACH(pagedep, pagedephd, pd_hash) { - if (ino == pagedep->pd_ino && lbn == pagedep->pd_lbn && - mp == pagedep->pd_list.wk_mp) { + if (ino == pagedep->pd_ino && lbn == pagedep->pd_lbn) { *pagedeppp = pagedep; return (1); } @@ -2092,10 +2082,12 @@ pagedep_lookup(mp, bp, ino, lbn, flags, pagedeppp) struct pagedep *pagedep; struct pagedep_hashhead *pagedephd; struct worklist *wk; + struct ufsmount *ump; int ret; int i; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); if (bp) { LIST_FOREACH(wk, &bp->b_dep, wk_list) { if (wk->wk_type == D_PAGEDEP) { @@ -2104,8 +2096,8 @@ pagedep_lookup(mp, bp, ino, lbn, flags, pagedeppp) } } } - pagedephd = PAGEDEP_HASH(mp, ino, lbn); - ret = pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp); + pagedephd = PAGEDEP_HASH(ump, ino, lbn); + ret = pagedep_find(pagedephd, ino, lbn, pagedeppp); if (ret) { if (((*pagedeppp)->pd_state & ONWORKLIST) == 0 && bp) WORKLIST_INSERT(&bp->b_dep, &(*pagedeppp)->pd_list); @@ -2113,12 +2105,12 @@ pagedep_lookup(mp, bp, ino, lbn, flags, pagedeppp) } if ((flags & DEPALLOC) == 0) return (0); - FREE_LOCK(&lk); + FREE_LOCK(ump); pagedep = malloc(sizeof(struct pagedep), M_PAGEDEP, M_SOFTDEP_FLAGS|M_ZERO); workitem_alloc(&pagedep->pd_list, D_PAGEDEP, mp); - ACQUIRE_LOCK(&lk); - ret = pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp); + ACQUIRE_LOCK(ump); + ret = pagedep_find(pagedephd, ino, lbn, pagedeppp); if (*pagedeppp) { /* * This should never happen since we only create pagedeps @@ -2142,15 +2134,12 @@ pagedep_lookup(mp, bp, ino, lbn, flags, pagedeppp) /* * Structures and routines associated with inodedep caching. */ -LIST_HEAD(inodedep_hashhead, inodedep) *inodedep_hashtbl; -static u_long inodedep_hash; /* size of hash table - 1 */ -#define INODEDEP_HASH(fs, inum) \ - (&inodedep_hashtbl[((((register_t)(fs)) >> 13) + (inum)) & inodedep_hash]) +#define INODEDEP_HASH(ump, inum) \ + (&(ump)->inodedep_hashtbl[(inum) & (ump)->inodedep_hash_size]) static int -inodedep_find(inodedephd, fs, inum, inodedeppp) +inodedep_find(inodedephd, inum, inodedeppp) struct inodedep_hashhead *inodedephd; - struct fs *fs; ino_t inum; struct inodedep **inodedeppp; { @@ -2157,7 +2146,7 @@ static int struct inodedep *inodedep; LIST_FOREACH(inodedep, inodedephd, id_hash) - if (inum == inodedep->id_ino && fs == inodedep->id_fs) + if (inum == inodedep->id_ino) break; if (inodedep) { *inodedeppp = inodedep; @@ -2182,13 +2171,15 @@ inodedep_lookup(mp, inum, flags, inodedeppp) { struct inodedep *inodedep; struct inodedep_hashhead *inodedephd; + struct ufsmount *ump; struct fs *fs; - rw_assert(&lk, RA_WLOCKED); - fs = VFSTOUFS(mp)->um_fs; - inodedephd = INODEDEP_HASH(fs, inum); + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); + fs = ump->um_fs; + inodedephd = INODEDEP_HASH(ump, inum); - if (inodedep_find(inodedephd, fs, inum, inodedeppp)) + if (inodedep_find(inodedephd, inum, inodedeppp)) return (1); if ((flags & DEPALLOC) == 0) return (0); @@ -2197,12 +2188,12 @@ inodedep_lookup(mp, inum, flags, inodedeppp) */ if (dep_current[D_INODEDEP] > max_softdeps && (flags & NODELAY) == 0) request_cleanup(mp, FLUSH_INODES); - FREE_LOCK(&lk); + FREE_LOCK(ump); inodedep = malloc(sizeof(struct inodedep), M_INODEDEP, M_SOFTDEP_FLAGS); workitem_alloc(&inodedep->id_list, D_INODEDEP, mp); - ACQUIRE_LOCK(&lk); - if (inodedep_find(inodedephd, fs, inum, inodedeppp)) { + ACQUIRE_LOCK(ump); + if (inodedep_find(inodedephd, inum, inodedeppp)) { WORKITEM_FREE(inodedep, D_INODEDEP); return (1); } @@ -2234,15 +2225,12 @@ inodedep_lookup(mp, inum, flags, inodedeppp) /* * Structures and routines associated with newblk caching. */ -LIST_HEAD(newblk_hashhead, newblk) *newblk_hashtbl; -u_long newblk_hash; /* size of hash table - 1 */ -#define NEWBLK_HASH(fs, inum) \ - (&newblk_hashtbl[((((register_t)(fs)) >> 13) + (inum)) & newblk_hash]) +#define NEWBLK_HASH(ump, inum) \ + (&(ump)->newblk_hashtbl[(inum) & (ump)->newblk_hash_size]) static int -newblk_find(newblkhd, mp, newblkno, flags, newblkpp) +newblk_find(newblkhd, newblkno, flags, newblkpp) struct newblk_hashhead *newblkhd; - struct mount *mp; ufs2_daddr_t newblkno; int flags; struct newblk **newblkpp; @@ -2252,8 +2240,6 @@ static int LIST_FOREACH(newblk, newblkhd, nb_hash) { if (newblkno != newblk->nb_newblkno) continue; - if (mp != newblk->nb_list.wk_mp) - continue; /* * If we're creating a new dependency don't match those that * have already been converted to allocdirects. This is for @@ -2285,18 +2271,21 @@ newblk_lookup(mp, newblkno, flags, newblkpp) { struct newblk *newblk; struct newblk_hashhead *newblkhd; + struct ufsmount *ump; - newblkhd = NEWBLK_HASH(VFSTOUFS(mp)->um_fs, newblkno); - if (newblk_find(newblkhd, mp, newblkno, flags, newblkpp)) + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); + newblkhd = NEWBLK_HASH(ump, newblkno); + if (newblk_find(newblkhd, newblkno, flags, newblkpp)) return (1); if ((flags & DEPALLOC) == 0) return (0); - FREE_LOCK(&lk); + FREE_LOCK(ump); newblk = malloc(sizeof(union allblk), M_NEWBLK, M_SOFTDEP_FLAGS | M_ZERO); workitem_alloc(&newblk->nb_list, D_NEWBLK, mp); - ACQUIRE_LOCK(&lk); - if (newblk_find(newblkhd, mp, newblkno, flags, newblkpp)) { + ACQUIRE_LOCK(ump); + if (newblk_find(newblkhd, newblkno, flags, newblkpp)) { WORKITEM_FREE(newblk, D_NEWBLK); return (1); } @@ -2314,10 +2303,8 @@ newblk_lookup(mp, newblkno, flags, newblkpp) /* * Structures and routines associated with freed indirect block caching. */ -struct freeworklst *indir_hashtbl; -u_long indir_hash; /* size of hash table - 1 */ -#define INDIR_HASH(mp, blkno) \ - (&indir_hashtbl[((((register_t)(mp)) >> 13) + (blkno)) & indir_hash]) +#define INDIR_HASH(ump, blkno) \ + (&(ump)->indir_hashtbl[(blkno) & (ump)->indir_hash_size]) /* * Lookup an indirect block in the indir hash table. The freework is @@ -2330,14 +2317,14 @@ indirblk_lookup(mp, blkno) ufs2_daddr_t blkno; { struct freework *freework; - struct freeworklst *wkhd; + struct indir_hashhead *wkhd; + struct ufsmount *ump; - wkhd = INDIR_HASH(mp, blkno); + ump = VFSTOUFS(mp); + wkhd = INDIR_HASH(ump, blkno); TAILQ_FOREACH(freework, wkhd, fw_next) { if (freework->fw_blkno != blkno) continue; - if (freework->fw_list.wk_mp != mp) - continue; indirblk_remove(freework); return (1); } @@ -2355,15 +2342,17 @@ indirblk_insert(freework) { struct jblocks *jblocks; struct jseg *jseg; + struct ufsmount *ump; - jblocks = VFSTOUFS(freework->fw_list.wk_mp)->softdep_jblocks; + ump = VFSTOUFS(freework->fw_list.wk_mp); + jblocks = ump->softdep_jblocks; jseg = TAILQ_LAST(&jblocks->jb_segs, jseglst); if (jseg == NULL) return; LIST_INSERT_HEAD(&jseg->js_indirs, freework, fw_segs); - TAILQ_INSERT_HEAD(INDIR_HASH(freework->fw_list.wk_mp, - freework->fw_blkno), freework, fw_next); + TAILQ_INSERT_HEAD(INDIR_HASH(ump, freework->fw_blkno), freework, + fw_next); freework->fw_state &= ~DEPCOMPLETE; } @@ -2371,10 +2360,11 @@ static void indirblk_remove(freework) struct freework *freework; { + struct ufsmount *ump; + ump = VFSTOUFS(freework->fw_list.wk_mp); LIST_REMOVE(freework, fw_segs); - TAILQ_REMOVE(INDIR_HASH(freework->fw_list.wk_mp, - freework->fw_blkno), freework, fw_next); + TAILQ_REMOVE(INDIR_HASH(ump, freework->fw_blkno), freework, fw_next); freework->fw_state |= DEPCOMPLETE; if ((freework->fw_state & ALLCOMPLETE) == ALLCOMPLETE) WORKITEM_FREE(freework, D_FREEWORK); @@ -2387,20 +2377,8 @@ indirblk_remove(freework) void softdep_initialize() { - int i; - LIST_INIT(&mkdirlisthd); max_softdeps = desiredvnodes * 4; - pagedep_hashtbl = hashinit(desiredvnodes / 5, M_PAGEDEP, &pagedep_hash); - inodedep_hashtbl = hashinit(desiredvnodes, M_INODEDEP, &inodedep_hash); - newblk_hashtbl = hashinit(max_softdeps / 2, M_NEWBLK, &newblk_hash); - bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, &bmsafemap_hash); - i = 1 << (ffs(desiredvnodes / 10) - 1); - indir_hashtbl = malloc(i * sizeof(indir_hashtbl[0]), M_FREEWORK, - M_WAITOK); - indir_hash = i - 1; - for (i = 0; i <= indir_hash; i++) - TAILQ_INIT(&indir_hashtbl[i]); /* initialise bioops hack */ bioops.io_start = softdep_disk_io_initiation; @@ -2420,12 +2398,13 @@ void softdep_uninitialize() { + /* clear bioops hack */ + bioops.io_start = NULL; + bioops.io_complete = NULL; + bioops.io_deallocate = NULL; + bioops.io_countdeps = NULL; + callout_drain(&softdep_callout); - hashdestroy(pagedep_hashtbl, M_PAGEDEP, pagedep_hash); - hashdestroy(inodedep_hashtbl, M_INODEDEP, inodedep_hash); - hashdestroy(newblk_hashtbl, M_NEWBLK, newblk_hash); - hashdestroy(bmsafemap_hashtbl, M_BMSAFEMAP, bmsafemap_hash); - free(indir_hashtbl, M_FREEWORK); } /* @@ -2440,11 +2419,14 @@ softdep_mount(devvp, mp, fs, cred) struct ucred *cred; { struct csum_total cstotal; + struct mount_softdeps *sdp; struct ufsmount *ump; struct cg *cgp; struct buf *bp; - int error, cyl; + int i, error, cyl; + sdp = malloc(sizeof(struct mount_softdeps), M_MOUNTDATA, + M_WAITOK | M_ZERO); MNT_ILOCK(mp); mp->mnt_flag = (mp->mnt_flag & ~MNT_ASYNC) | MNT_SOFTDEP; if ((mp->mnt_kern_flag & MNTK_SOFTDEP) == 0) { @@ -2451,8 +2433,10 @@ softdep_mount(devvp, mp, fs, cred) mp->mnt_kern_flag = (mp->mnt_kern_flag & ~MNTK_ASYNC) | MNTK_SOFTDEP | MNTK_NOASYNC; } + ump = VFSTOUFS(mp); + ump->um_softdep = sdp; MNT_IUNLOCK(mp); - ump = VFSTOUFS(mp); + rw_init(LOCK_PTR(ump), "Per-Filesystem Softdep Lock"); LIST_INIT(&ump->softdep_workitem_pending); LIST_INIT(&ump->softdep_journal_pending); TAILQ_INIT(&ump->softdep_unlinked); @@ -2460,12 +2444,36 @@ softdep_mount(devvp, mp, fs, cred) ump->softdep_worklist_tail = NULL; ump->softdep_on_worklist = 0; ump->softdep_deps = 0; + LIST_INIT(&ump->softdep_mkdirlisthd); + ump->pagedep_hashtbl = hashinit(desiredvnodes / 5, M_PAGEDEP, + &ump->pagedep_hash_size); + ump->pagedep_nextclean = 0; + ump->inodedep_hashtbl = hashinit(desiredvnodes, M_INODEDEP, + &ump->inodedep_hash_size); + ump->inodedep_nextclean = 0; + ump->newblk_hashtbl = hashinit(max_softdeps / 2, M_NEWBLK, + &ump->newblk_hash_size); + ump->bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, + &ump->bmsafemap_hash_size); + i = 1 << (ffs(desiredvnodes / 10) - 1); + ump->indir_hashtbl = malloc(i * sizeof(struct indir_hashhead), + M_FREEWORK, M_WAITOK); + ump->indir_hash_size = i - 1; + for (i = 0; i <= ump->indir_hash_size; i++) + TAILQ_INIT(&ump->indir_hashtbl[i]); if ((fs->fs_flags & FS_SUJ) && (error = journal_mount(mp, fs, cred)) != 0) { printf("Failed to start journal: %d\n", error); + softdep_unmount(mp); return (error); } /* + * Start our flushing thread. + */ + kproc_kthread_add(&softdep_flush, mp, &softdepproc, + &ump->softdep_flushtd, 0, 0, "softdepflush", "%s worker", + mp->mnt_stat.f_mntonname); + /* * When doing soft updates, the counters in the * superblock may have gotten out of sync. Recomputation * can take a long time and can be deferred for background @@ -2480,6 +2488,7 @@ softdep_mount(devvp, mp, fs, cred) if ((error = bread(devvp, fsbtodb(fs, cgtod(fs, cyl)), fs->fs_cgsize, cred, &bp)) != 0) { brelse(bp); + softdep_unmount(mp); return (error); } cgp = (struct cg *)bp->b_data; @@ -2502,16 +2511,43 @@ void softdep_unmount(mp) struct mount *mp; { + struct ufsmount *ump; + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_unmount called on non-softdep filesystem")); + ump = VFSTOUFS(mp); MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_SOFTDEP; if (MOUNTEDSUJ(mp) == 0) { MNT_IUNLOCK(mp); - return; + } else { + mp->mnt_flag &= ~MNT_SUJ; + MNT_IUNLOCK(mp); + journal_unmount(ump); } - mp->mnt_flag &= ~MNT_SUJ; - MNT_IUNLOCK(mp); - journal_unmount(mp); + /* + * Shut down our flushing thread. + */ + if (ump->softdep_flushtd != NULL) { + ACQUIRE_LOCK(ump); + ump->softdep_flags |= FLUSH_EXIT; + wakeup(&req_pending); + msleep(&ump->softdep_flags, LOCK_PTR(ump), PVM | PDROP, + "sdwait", 0); + KASSERT((ump->softdep_flags & FLUSH_EXIT) == 0, + ("Thread shutdown failed\n")); + } + /* + * Free up our resources. + */ + rw_destroy(LOCK_PTR(ump)); + hashdestroy(ump->pagedep_hashtbl, M_PAGEDEP, ump->pagedep_hash_size); + hashdestroy(ump->inodedep_hashtbl, M_INODEDEP, ump->inodedep_hash_size); + hashdestroy(ump->newblk_hashtbl, M_NEWBLK, ump->newblk_hash_size); + hashdestroy(ump->bmsafemap_hashtbl, M_BMSAFEMAP, + ump->bmsafemap_hash_size); + free(ump->indir_hashtbl, M_FREEWORK); + free(ump->um_softdep, M_MOUNTDATA); } static struct jblocks * @@ -2566,9 +2602,10 @@ jblocks_free(jblocks, mp, bytes) int bytes; { + LOCK_OWNED(VFSTOUFS(mp)); jblocks->jb_free += bytes / DEV_BSIZE; if (jblocks->jb_suspended) - worklist_speedup(); + worklist_speedup(mp); wakeup(jblocks); } @@ -2659,6 +2696,7 @@ journal_mount(mp, fs, cred) struct ucred *cred; { struct jblocks *jblocks; + struct ufsmount *ump; struct vnode *vp; struct inode *ip; ufs2_daddr_t blkno; @@ -2666,6 +2704,12 @@ journal_mount(mp, fs, cred) int error; int i; + ump = VFSTOUFS(mp); + ump->softdep_journal_tail = NULL; + ump->softdep_on_journal = 0; + ump->softdep_accdeps = 0; + ump->softdep_req = 0; + ump->softdep_jblocks = NULL; error = softdep_journal_lookup(mp, &vp); if (error != 0) { printf("Failed to find journal. Use tunefs to create one\n"); @@ -2690,7 +2734,7 @@ journal_mount(mp, fs, cred) } jblocks->jb_low = jblocks->jb_free / 3; /* Reserve 33%. */ jblocks->jb_min = jblocks->jb_free / 10; /* Suspend at 10%. */ - VFSTOUFS(mp)->softdep_jblocks = jblocks; + ump->softdep_jblocks = jblocks; out: if (error == 0) { MNT_ILOCK(mp); @@ -2716,12 +2760,10 @@ out: } static void -journal_unmount(mp) - struct mount *mp; +journal_unmount(ump) + struct ufsmount *ump; { - struct ufsmount *ump; - ump = VFSTOUFS(mp); if (ump->softdep_jblocks) jblocks_destroy(ump->softdep_jblocks); ump->softdep_jblocks = NULL; @@ -2738,8 +2780,8 @@ add_to_journal(wk) { struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); + LOCK_OWNED(ump); if (wk->wk_state & ONWORKLIST) panic("add_to_journal: %s(0x%X) already on list", TYPENAME(wk->wk_type), wk->wk_state); @@ -2764,8 +2806,8 @@ remove_from_journal(wk) { struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); ump = VFSTOUFS(wk->wk_mp); + LOCK_OWNED(ump); #ifdef SUJ_DEBUG { struct worklist *wkn; @@ -2836,7 +2878,7 @@ journal_suspend(ump) if ((mp->mnt_kern_flag & MNTK_SUSPEND) == 0) { stat_journal_min++; mp->mnt_kern_flag |= MNTK_SUSPEND; - mp->mnt_susp_owner = FIRST_THREAD_IN_PROC(softdepproc); + mp->mnt_susp_owner = ump->softdep_flushtd; } jblocks->jb_suspended = 1; MNT_IUNLOCK(mp); @@ -2854,10 +2896,10 @@ journal_unsuspend(struct ufsmount *ump) if (jblocks != NULL && jblocks->jb_suspended && journal_space(ump, jblocks->jb_min)) { jblocks->jb_suspended = 0; - FREE_LOCK(&lk); + FREE_LOCK(ump); mp->mnt_susp_owner = curthread; vfs_write_resume(mp, 0); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); return (1); } return (0); @@ -2882,6 +2924,8 @@ softdep_prealloc(vp, waitok) { struct ufsmount *ump; + KASSERT(MOUNTEDSOFTDEP(vp->v_mount) != 0, + ("softdep_prealloc called on non-softdep filesystem")); /* * Nothing to do if we are not running journaled soft updates. * If we currently hold the snapshot lock, we must avoid handling @@ -2890,13 +2934,13 @@ softdep_prealloc(vp, waitok) if (DOINGSUJ(vp) == 0 || IS_SNAPSHOT(VTOI(vp))) return (0); ump = VFSTOUFS(vp->v_mount); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (journal_space(ump, 0)) { - FREE_LOCK(&lk); + FREE_LOCK(ump); return (0); } stat_journal_low++; - FREE_LOCK(&lk); + FREE_LOCK(ump); if (waitok == MNT_NOWAIT) return (ENOSPC); /* @@ -2905,7 +2949,7 @@ softdep_prealloc(vp, waitok) */ if ((curthread->td_pflags & TDP_COWINPROGRESS) == 0) ffs_syncvnode(vp, waitok, 0); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); process_removes(vp); process_truncates(vp); if (journal_space(ump, 0) == 0) { @@ -2913,7 +2957,7 @@ softdep_prealloc(vp, waitok) if (journal_space(ump, 1) == 0) journal_suspend(ump); } - FREE_LOCK(&lk); + FREE_LOCK(ump); return (0); } @@ -2932,7 +2976,7 @@ softdep_prelink(dvp, vp) struct ufsmount *ump; ump = VFSTOUFS(dvp->v_mount); - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(ump); /* * Nothing to do if we have sufficient journal space. * If we currently hold the snapshot lock, we must avoid @@ -2941,11 +2985,11 @@ softdep_prelink(dvp, vp) if (journal_space(ump, 0) || (vp && IS_SNAPSHOT(VTOI(vp)))) return; stat_journal_low++; - FREE_LOCK(&lk); + FREE_LOCK(ump); if (vp) ffs_syncvnode(vp, MNT_NOWAIT, 0); ffs_syncvnode(dvp, MNT_WAIT, 0); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); /* Process vp before dvp as it may create .. removes. */ if (vp) { process_removes(vp); @@ -3132,12 +3176,12 @@ softdep_flushjournal(mp) return; ump = VFSTOUFS(mp); jblocks = ump->softdep_jblocks; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); while (ump->softdep_on_journal) { jblocks->jb_needseg = 1; softdep_process_journal(mp, NULL, MNT_WAIT); } - FREE_LOCK(&lk); + FREE_LOCK(ump); } static void softdep_synchronize_completed(struct bio *); @@ -3149,6 +3193,7 @@ softdep_synchronize_completed(bp) { struct jseg *oldest; struct jseg *jseg; + struct ufsmount *ump; /* * caller1 marks the last segment written before we issued the @@ -3155,8 +3200,13 @@ softdep_synchronize_completed(bp) * synchronize cache. */ jseg = bp->bio_caller1; + if (jseg == NULL) { + g_destroy_bio(bp); + return; + } + ump = VFSTOUFS(jseg->js_list.wk_mp); + ACQUIRE_LOCK(ump); oldest = NULL; - ACQUIRE_LOCK(&lk); /* * Mark all the journal entries waiting on the synchronize cache * as completed so they may continue on. @@ -3173,7 +3223,7 @@ softdep_synchronize_completed(bp) if (oldest) complete_jsegs(oldest); - FREE_LOCK(&lk); + FREE_LOCK(ump); g_destroy_bio(bp); } @@ -3233,6 +3283,7 @@ softdep_process_journal(mp, needwk, flags) bio = NULL; jseg = NULL; ump = VFSTOUFS(mp); + LOCK_OWNED(ump); fs = ump->um_fs; jblocks = ump->softdep_jblocks; devbsize = ump->um_devvp->v_bufobj.bo_bsize; @@ -3272,9 +3323,9 @@ softdep_process_journal(mp, needwk, flags) break; printf("softdep: Out of journal space!\n"); softdep_speedup(); - msleep(jblocks, &lk, PRIBIO, "jblocks", hz); + msleep(jblocks, LOCK_PTR(ump), PRIBIO, "jblocks", hz); } - FREE_LOCK(&lk); + FREE_LOCK(ump); jseg = malloc(sizeof(*jseg), M_JSEG, M_SOFTDEP_FLAGS); workitem_alloc(&jseg->js_list, D_JSEG, mp); LIST_INIT(&jseg->js_entries); @@ -3286,7 +3337,7 @@ softdep_process_journal(mp, needwk, flags) bio = g_alloc_bio(); jseg->js_jblocks = jblocks; bp = geteblk(fs->fs_bsize, 0); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); /* * If there was a race while we were allocating the block * and jseg the entry we care about was likely written. @@ -3298,9 +3349,9 @@ softdep_process_journal(mp, needwk, flags) if (cnt + jblocks->jb_needseg == 0 || jblocks->jb_free == 0) { bp->b_flags |= B_INVAL | B_NOCACHE; WORKITEM_FREE(jseg, D_JSEG); - FREE_LOCK(&lk); + FREE_LOCK(ump); brelse(bp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); break; } /* @@ -3400,7 +3451,7 @@ softdep_process_journal(mp, needwk, flags) segwritten = 1; jblocks->jb_needseg = 0; WORKLIST_INSERT(&bp->b_dep, &jseg->js_list); - FREE_LOCK(&lk); + FREE_LOCK(ump); pbgetvp(ump->um_devvp, bp); /* * We only do the blocking wait once we find the journal @@ -3410,7 +3461,7 @@ softdep_process_journal(mp, needwk, flags) bwrite(bp); else bawrite(bp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } /* * If we wrote a segment issue a synchronize cache so the journal @@ -3431,10 +3482,10 @@ softdep_process_journal(mp, needwk, flags) if (flags == 0 && jblocks->jb_suspended) { if (journal_unsuspend(ump)) return; - FREE_LOCK(&lk); + FREE_LOCK(ump); VFS_SYNC(mp, MNT_NOWAIT); ffs_sbupdate(ump, MNT_WAIT, 0); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } } @@ -3961,8 +4012,8 @@ free_freedep(freedep) /* * Allocate a new freework structure that may be a level in an indirect * when parent is not NULL or a top level block when it is. The top level - * freework structures are allocated without lk held and before the freeblks - * is visible outside of softdep_setup_freeblocks(). + * freework structures are allocated without the per-filesystem lock held + * and before the freeblks is visible outside of softdep_setup_freeblocks(). */ static struct freework * newfreework(ump, freeblks, parent, lbn, nb, frags, off, journal) @@ -3993,10 +4044,10 @@ newfreework(ump, freeblks, parent, lbn, nb, frags, if (journal) newjfreeblk(freeblks, lbn, nb, frags); if (parent == NULL) { - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); WORKLIST_INSERT(&freeblks->fb_freeworkhd, &freework->fw_list); freeblks->fb_ref++; - FREE_LOCK(&lk); + FREE_LOCK(ump); } return (freework); @@ -4030,7 +4081,8 @@ cancel_jfreeblk(freeblks, blkno) /* * Allocate a new jfreeblk to journal top level block pointer when truncating - * a file. The caller must add this to the worklist when lk is held. + * a file. The caller must add this to the worklist when the per-filesystem + * lock is held. */ static struct jfreeblk * newjfreeblk(freeblks, lbn, blkno, frags) @@ -4418,6 +4470,7 @@ jwait(wk, waitfor) int waitfor; { + LOCK_OWNED(VFSTOUFS(wk->wk_mp)); /* * Blocking journal waits cause slow synchronous behavior. Record * stats on the frequency of these blocking operations. @@ -4501,10 +4554,12 @@ softdep_setup_create(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_create called on non-softdep filesystem")); KASSERT(ip->i_nlink == 1, ("softdep_setup_create: Invalid link count.")); dvp = ITOV(dp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); inodedep = inodedep_lookup_ip(ip); if (DOINGSUJ(dvp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -4513,7 +4568,7 @@ softdep_setup_create(dp, ip) ("softdep_setup_create: No addref structure present.")); } softdep_prelink(dvp, NULL); - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -4532,6 +4587,8 @@ softdep_setup_dotdot_link(dp, ip) struct vnode *dvp; struct vnode *vp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_dotdot_link called on non-softdep filesystem")); dvp = ITOV(dp); vp = ITOV(ip); jaddref = NULL; @@ -4542,13 +4599,13 @@ softdep_setup_dotdot_link(dp, ip) if (DOINGSUJ(dvp)) jaddref = newjaddref(ip, dp->i_number, DOTDOT_OFFSET, dp->i_effnlink - 1, dp->i_mode); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); inodedep = inodedep_lookup_ip(dp); if (jaddref) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref, if_deps); softdep_prelink(dvp, ITOV(ip)); - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -4566,18 +4623,20 @@ softdep_setup_link(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_link called on non-softdep filesystem")); dvp = ITOV(dp); jaddref = NULL; if (DOINGSUJ(dvp)) jaddref = newjaddref(dp, ip->i_number, 0, ip->i_effnlink - 1, ip->i_mode); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); inodedep = inodedep_lookup_ip(ip); if (jaddref) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &jaddref->ja_ref, if_deps); softdep_prelink(dvp, ITOV(ip)); - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -4597,6 +4656,8 @@ softdep_setup_mkdir(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_mkdir called on non-softdep filesystem")); dvp = ITOV(dp); dotaddref = dotdotaddref = NULL; if (DOINGSUJ(dvp)) { @@ -4607,7 +4668,7 @@ softdep_setup_mkdir(dp, ip) dp->i_effnlink - 1, dp->i_mode); dotdotaddref->ja_state |= MKDIR_PARENT; } - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); inodedep = inodedep_lookup_ip(ip); if (DOINGSUJ(dvp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -4625,7 +4686,7 @@ softdep_setup_mkdir(dp, ip) TAILQ_INSERT_TAIL(&inodedep->id_inoreflst, &dotdotaddref->ja_ref, if_deps); softdep_prelink(ITOV(dp), NULL); - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -4639,12 +4700,14 @@ softdep_setup_rmdir(dp, ip) { struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_rmdir called on non-softdep filesystem")); dvp = ITOV(dp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); (void) inodedep_lookup_ip(ip); (void) inodedep_lookup_ip(dp); softdep_prelink(dvp, ITOV(ip)); - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -4658,12 +4721,14 @@ softdep_setup_unlink(dp, ip) { struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_setup_unlink called on non-softdep filesystem")); dvp = ITOV(dp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); (void) inodedep_lookup_ip(ip); (void) inodedep_lookup_ip(dp); softdep_prelink(dvp, ITOV(ip)); - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -4679,8 +4744,10 @@ softdep_revert_create(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_revert_create called on non-softdep filesystem")); dvp = ITOV(dp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); inodedep = inodedep_lookup_ip(ip); if (DOINGSUJ(dvp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -4689,36 +4756,10 @@ softdep_revert_create(dp, ip) ("softdep_revert_create: addref parent mismatch")); cancel_jaddref(jaddref, inodedep, &inodedep->id_inowait); } - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* - * Called to release the journal structures created by a failed dotdot link - * creation. Adjusts nlinkdelta for non-journaling softdep. - */ -void -softdep_revert_dotdot_link(dp, ip) - struct inode *dp; - struct inode *ip; -{ - struct inodedep *inodedep; - struct jaddref *jaddref; - struct vnode *dvp; - - dvp = ITOV(dp); - ACQUIRE_LOCK(&lk); - inodedep = inodedep_lookup_ip(dp); - if (DOINGSUJ(dvp)) { - jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, - inoreflst); - KASSERT(jaddref->ja_parent == ip->i_number, - ("softdep_revert_dotdot_link: addref parent mismatch")); - cancel_jaddref(jaddref, inodedep, &inodedep->id_inowait); - } - FREE_LOCK(&lk); -} - -/* * Called to release the journal structures created by a failed link * addition. Adjusts nlinkdelta for non-journaling softdep. */ @@ -4731,8 +4772,10 @@ softdep_revert_link(dp, ip) struct jaddref *jaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_revert_link called on non-softdep filesystem")); dvp = ITOV(dp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); inodedep = inodedep_lookup_ip(ip); if (DOINGSUJ(dvp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -4741,7 +4784,7 @@ softdep_revert_link(dp, ip) ("softdep_revert_link: addref parent mismatch")); cancel_jaddref(jaddref, inodedep, &inodedep->id_inowait); } - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -4758,9 +4801,11 @@ softdep_revert_mkdir(dp, ip) struct jaddref *dotaddref; struct vnode *dvp; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_revert_mkdir called on non-softdep filesystem")); dvp = ITOV(dp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); inodedep = inodedep_lookup_ip(dp); if (DOINGSUJ(dvp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, @@ -4782,7 +4827,7 @@ softdep_revert_mkdir(dp, ip) ("softdep_revert_mkdir: dot addref parent mismatch")); cancel_jaddref(dotaddref, inodedep, &inodedep->id_inowait); } - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -4794,10 +4839,12 @@ softdep_revert_rmdir(dp, ip) struct inode *ip; { - ACQUIRE_LOCK(&lk); + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, + ("softdep_revert_rmdir called on non-softdep filesystem")); + ACQUIRE_LOCK(dp->i_ump); (void) inodedep_lookup_ip(ip); (void) inodedep_lookup_ip(dp); - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -4849,6 +4896,8 @@ softdep_setup_inomapdep(bp, ip, newinum, mode) struct fs *fs; mp = UFSTOVFS(ip->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_inomapdep called on non-softdep filesystem")); fs = ip->i_ump->um_fs; jaddref = NULL; @@ -4881,7 +4930,7 @@ softdep_setup_inomapdep(bp, ip, newinum, mode) bmsafemap = malloc(sizeof(struct bmsafemap), M_BMSAFEMAP, M_SOFTDEP_FLAGS); workitem_alloc(&bmsafemap->sm_list, D_BMSAFEMAP, mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); if ((inodedep_lookup(mp, newinum, DEPALLOC | NODELAY, &inodedep))) panic("softdep_setup_inomapdep: dependency %p for new" "inode already exists", inodedep); @@ -4896,7 +4945,7 @@ softdep_setup_inomapdep(bp, ip, newinum, mode) } inodedep->id_bmsafemap = bmsafemap; inodedep->id_state &= ~DEPCOMPLETE; - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); } /* @@ -4914,9 +4963,13 @@ softdep_setup_blkmapdep(bp, mp, newblkno, frags, o struct newblk *newblk; struct bmsafemap *bmsafemap; struct jnewblk *jnewblk; + struct ufsmount *ump; struct fs *fs; - fs = VFSTOUFS(mp)->um_fs; + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_blkmapdep called on non-softdep filesystem")); + ump = VFSTOUFS(mp); + fs = ump->um_fs; jnewblk = NULL; /* * Create a dependency for the newly allocated block. @@ -4959,7 +5012,7 @@ softdep_setup_blkmapdep(bp, mp, newblkno, frags, o CTR3(KTR_SUJ, "softdep_setup_blkmapdep: blkno %jd frags %d oldfrags %d", newblkno, frags, oldfrags); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (newblk_lookup(mp, newblkno, DEPALLOC, &newblk) != 0) panic("softdep_setup_blkmapdep: found block"); newblk->nb_bmsafemap = bmsafemap = bmsafemap_lookup(mp, bp, @@ -4973,16 +5026,15 @@ softdep_setup_blkmapdep(bp, mp, newblkno, frags, o } newblk->nb_bmsafemap = bmsafemap; newblk->nb_jnewblk = jnewblk; - FREE_LOCK(&lk); + FREE_LOCK(ump); } -#define BMSAFEMAP_HASH(fs, cg) \ - (&bmsafemap_hashtbl[((((register_t)(fs)) >> 13) + (cg)) & bmsafemap_hash]) +#define BMSAFEMAP_HASH(ump, cg) \ + (&(ump)->bmsafemap_hashtbl[(cg) & (ump)->bmsafemap_hash_size]) static int -bmsafemap_find(bmsafemaphd, mp, cg, bmsafemapp) +bmsafemap_find(bmsafemaphd, cg, bmsafemapp) struct bmsafemap_hashhead *bmsafemaphd; - struct mount *mp; int cg; struct bmsafemap **bmsafemapp; { @@ -4989,7 +5041,7 @@ static int struct bmsafemap *bmsafemap; LIST_FOREACH(bmsafemap, bmsafemaphd, sm_hash) - if (bmsafemap->sm_list.wk_mp == mp && bmsafemap->sm_cg == cg) + if (bmsafemap->sm_cg == cg) break; if (bmsafemap) { *bmsafemapp = bmsafemap; @@ -5018,9 +5070,10 @@ bmsafemap_lookup(mp, bp, cg, newbmsafemap) struct bmsafemap_hashhead *bmsafemaphd; struct bmsafemap *bmsafemap, *collision; struct worklist *wk; - struct fs *fs; + struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); KASSERT(bp != NULL, ("bmsafemap_lookup: missing buffer")); LIST_FOREACH(wk, &bp->b_dep, wk_list) { if (wk->wk_type == D_BMSAFEMAP) { @@ -5029,9 +5082,8 @@ bmsafemap_lookup(mp, bp, cg, newbmsafemap) return (WK_BMSAFEMAP(wk)); } } - fs = VFSTOUFS(mp)->um_fs; - bmsafemaphd = BMSAFEMAP_HASH(fs, cg); - if (bmsafemap_find(bmsafemaphd, mp, cg, &bmsafemap) == 1) { + bmsafemaphd = BMSAFEMAP_HASH(ump, cg); + if (bmsafemap_find(bmsafemaphd, cg, &bmsafemap) == 1) { if (newbmsafemap) WORKITEM_FREE(newbmsafemap, D_BMSAFEMAP); return (bmsafemap); @@ -5039,11 +5091,11 @@ bmsafemap_lookup(mp, bp, cg, newbmsafemap) if (newbmsafemap) { bmsafemap = newbmsafemap; } else { - FREE_LOCK(&lk); + FREE_LOCK(ump); bmsafemap = malloc(sizeof(struct bmsafemap), M_BMSAFEMAP, M_SOFTDEP_FLAGS); workitem_alloc(&bmsafemap->sm_list, D_BMSAFEMAP, mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } bmsafemap->sm_buf = bp; LIST_INIT(&bmsafemap->sm_inodedephd); @@ -5054,13 +5106,13 @@ bmsafemap_lookup(mp, bp, cg, newbmsafemap) LIST_INIT(&bmsafemap->sm_jnewblkhd); LIST_INIT(&bmsafemap->sm_freehd); LIST_INIT(&bmsafemap->sm_freewr); - if (bmsafemap_find(bmsafemaphd, mp, cg, &collision) == 1) { + if (bmsafemap_find(bmsafemaphd, cg, &collision) == 1) { WORKITEM_FREE(bmsafemap, D_BMSAFEMAP); return (collision); } bmsafemap->sm_cg = cg; LIST_INSERT_HEAD(bmsafemaphd, bmsafemap, sm_hash); - LIST_INSERT_HEAD(&VFSTOUFS(mp)->softdep_dirtycg, bmsafemap, sm_next); + LIST_INSERT_HEAD(&ump->softdep_dirtycg, bmsafemap, sm_next); WORKLIST_INSERT(&bp->b_dep, &bmsafemap->sm_list); return (bmsafemap); } @@ -5116,6 +5168,8 @@ softdep_setup_allocdirect(ip, off, newblkno, oldbl lbn = bp->b_lblkno; mp = UFSTOVFS(ip->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_allocdirect called on non-softdep filesystem")); if (oldblkno && oldblkno != newblkno) freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); else @@ -5125,7 +5179,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldbl "softdep_setup_allocdirect: ino %d blkno %jd oldblkno %jd " "off %jd newsize %ld oldsize %d", ip->i_number, newblkno, oldblkno, off, newsize, oldsize); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); if (off >= NDADDR) { if (lbn > 0) panic("softdep_setup_allocdirect: bad lbn %jd, off %jd", @@ -5197,7 +5251,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldbl TAILQ_INSERT_TAIL(adphead, adp, ad_next); if (oldadp != NULL && oldadp->ad_offset == off) allocdirect_merge(adphead, adp, oldadp); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); return; } TAILQ_FOREACH(oldadp, adphead, ad_next) { @@ -5211,7 +5265,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldbl if (oldadp->ad_offset == off) allocdirect_merge(adphead, adp, oldadp); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); } /* @@ -5291,7 +5345,7 @@ allocdirect_merge(adphead, newadp, oldadp) struct freefrag *freefrag; freefrag = NULL; - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(VFSTOUFS(newadp->ad_list.wk_mp)); if (newadp->ad_oldblkno != oldadp->ad_newblkno || newadp->ad_oldsize != oldadp->ad_newsize || newadp->ad_offset >= NDADDR) @@ -5449,7 +5503,7 @@ handle_workitem_freefrag(freefrag) * safe to modify the list head here. */ LIST_INIT(&wkhd); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); LIST_SWAP(&freefrag->ff_jwork, &wkhd, worklist, wk_list); /* * If the journal has not been written we must cancel it here. @@ -5460,12 +5514,12 @@ handle_workitem_freefrag(freefrag) freefrag->ff_jdep->wk_type); cancel_jnewblk(WK_JNEWBLK(freefrag->ff_jdep), &wkhd); } - FREE_LOCK(&lk); + FREE_LOCK(ump); ffs_blkfree(ump, ump->um_fs, ump->um_devvp, freefrag->ff_blkno, freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); WORKITEM_FREE(freefrag, D_FREEFRAG); - FREE_LOCK(&lk); + FREE_LOCK(ump); } /* @@ -5492,18 +5546,19 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno struct mount *mp; ufs_lbn_t lbn; - if (off >= NXADDR) - panic("softdep_setup_allocext: lbn %lld > NXADDR", - (long long)off); + mp = UFSTOVFS(ip->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_allocext called on non-softdep filesystem")); + KASSERT(off < NXADDR, ("softdep_setup_allocext: lbn %lld > NXADDR", + (long long)off)); lbn = bp->b_lblkno; - mp = UFSTOVFS(ip->i_ump); if (oldblkno && oldblkno != newblkno) freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); else freefrag = NULL; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); if (newblk_lookup(mp, newblkno, 0, &newblk) == 0) panic("softdep_setup_allocext: lost block"); KASSERT(newblk->nb_list.wk_type == D_NEWBLK, @@ -5554,7 +5609,7 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno TAILQ_INSERT_TAIL(adphead, adp, ad_next); if (oldadp != NULL && oldadp->ad_offset == off) allocdirect_merge(adphead, adp, oldadp); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); return; } TAILQ_FOREACH(oldadp, adphead, ad_next) { @@ -5567,7 +5622,7 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno TAILQ_INSERT_BEFORE(oldadp, adp, ad_next); if (oldadp->ad_offset == off) allocdirect_merge(adphead, adp, oldadp); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); } /* @@ -5615,7 +5670,7 @@ newallocindir(ip, ptrno, newblkno, oldblkno, lbn) freefrag = newfreefrag(ip, oldblkno, ip->i_fs->fs_bsize, lbn); else freefrag = NULL; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); if (newblk_lookup(UFSTOVFS(ip->i_ump), newblkno, 0, &newblk) == 0) panic("new_allocindir: lost block"); KASSERT(newblk->nb_list.wk_type == D_NEWBLK, @@ -5658,14 +5713,16 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, struct mount *mp; int dflags; - if (lbn != nbp->b_lblkno) - panic("softdep_setup_allocindir_page: lbn %jd != lblkno %jd", - lbn, bp->b_lblkno); + mp = UFSTOVFS(ip->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_allocindir_page called on non-softdep filesystem")); + KASSERT(lbn == nbp->b_lblkno, + ("softdep_setup_allocindir_page: lbn %jd != lblkno %jd", + lbn, bp->b_lblkno)); CTR4(KTR_SUJ, "softdep_setup_allocindir_page: ino %d blkno %jd oldblkno %jd " "lbn %jd", ip->i_number, newblkno, oldblkno, lbn); ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_page"); - mp = UFSTOVFS(ip->i_ump); aip = newallocindir(ip, ptrno, newblkno, oldblkno, lbn); dflags = DEPALLOC; if (IS_SNAPSHOT(ip)) @@ -5680,7 +5737,7 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, pagedep_lookup(mp, nbp, ip->i_number, lbn, DEPALLOC, &pagedep); WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list); freefrag = setup_allocindir_phase2(bp, ip, inodedep, aip, lbn); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); if (freefrag) handle_workitem_freefrag(freefrag); } @@ -5702,6 +5759,8 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, ufs_lbn_t lbn; int dflags; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_setup_allocindir_meta called on non-softdep filesystem")); CTR3(KTR_SUJ, "softdep_setup_allocindir_meta: ino %d blkno %jd ptrno %d", ip->i_number, newblkno, ptrno); @@ -5715,7 +5774,7 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list); if (setup_allocindir_phase2(bp, ip, inodedep, aip, lbn)) panic("softdep_setup_allocindir_meta: Block already existed"); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); } static void @@ -5748,11 +5807,13 @@ indirdep_lookup(mp, ip, bp) { struct indirdep *indirdep, *newindirdep; struct newblk *newblk; + struct ufsmount *ump; struct worklist *wk; struct fs *fs; ufs2_daddr_t blkno; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); indirdep = NULL; newindirdep = NULL; fs = ip->i_fs; @@ -5772,7 +5833,7 @@ indirdep_lookup(mp, ip, bp) if (indirdep == NULL && newindirdep != NULL) break; /* None found and no new structure available. */ - FREE_LOCK(&lk); + FREE_LOCK(ump); newindirdep = malloc(sizeof(struct indirdep), M_INDIRDEP, M_SOFTDEP_FLAGS); workitem_alloc(&newindirdep->ir_list, D_INDIRDEP, mp); @@ -5796,7 +5857,7 @@ indirdep_lookup(mp, ip, bp) newindirdep->ir_bp = bp; BUF_KERNPROC(newindirdep->ir_savebp); bcopy(bp->b_data, newindirdep->ir_savebp->b_data, bp->b_bcount); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } indirdep = newindirdep; WORKLIST_INSERT(&bp->b_dep, &indirdep->ir_list); @@ -5831,7 +5892,7 @@ setup_allocindir_phase2(bp, ip, inodedep, aip, lbn struct freefrag *freefrag; struct mount *mp; - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(ip->i_ump); mp = UFSTOVFS(ip->i_ump); fs = ip->i_fs; if (bp->b_lblkno >= 0) @@ -6086,7 +6147,7 @@ setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkn * allocations from proceeding until we are finished with the * truncate and the block is written. */ - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); indirdep = indirdep_lookup(mp, ip, bp); if (indirdep->ir_freeblks) panic("setup_trunc_indir: indirdep already truncated."); @@ -6103,7 +6164,7 @@ setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkn trunc_indirdep(indirn, freeblks, bp, off); } else trunc_indirdep(indirdep, freeblks, bp, off); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); /* * Creation is protected by the buf lock. The saveddata is only * needed if a full truncation follows a partial truncation but it @@ -6146,10 +6207,13 @@ complete_trunc_indir(freework) { struct freework *fwn; struct indirdep *indirdep; + struct ufsmount *ump; struct buf *bp; uintptr_t start; int count; + ump = VFSTOUFS(freework->fw_list.wk_mp); + LOCK_OWNED(ump); indirdep = freework->fw_indir; for (;;) { bp = indirdep->ir_bp; @@ -6159,12 +6223,11 @@ complete_trunc_indir(freework) /* Inline part of getdirtybuf(). We dont want bremfree. */ if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) break; - if (BUF_LOCK(bp, - LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, &lk) == 0) + if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, + LOCK_PTR(ump)) == 0) BUF_UNLOCK(bp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } - rw_assert(&lk, RA_WLOCKED); freework->fw_state |= DEPCOMPLETE; TAILQ_REMOVE(&indirdep->ir_trunc, freework, fw_next); /* @@ -6225,7 +6288,7 @@ complete_trunc_indir(freework) * Calculate the number of blocks we are going to release where datablocks * is the current total and length is the new file size. */ -ufs2_daddr_t +static ufs2_daddr_t blkcount(fs, datablocks, length) struct fs *fs; ufs2_daddr_t datablocks; @@ -6313,6 +6376,7 @@ softdep_journal_freeblocks(ip, cred, length, flags struct inodedep *inodedep; struct jblkdep *jblkdep; struct allocdirect *adp, *adpn; + struct ufsmount *ump; struct fs *fs; struct buf *bp; struct vnode *vp; @@ -6322,7 +6386,10 @@ softdep_journal_freeblocks(ip, cred, length, flags int frags, lastoff, iboff, allocblock, needj, dflags, error, i; fs = ip->i_fs; - mp = UFSTOVFS(ip->i_ump); + ump = ip->i_ump; + mp = UFSTOVFS(ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_journal_freeblocks called on non-softdep filesystem")); vp = ITOV(ip); needj = 1; iboff = -1; @@ -6331,7 +6398,7 @@ softdep_journal_freeblocks(ip, cred, length, flags datablocks = 0; frags = 0; freeblks = newfreeblks(mp, ip); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); /* * If we're truncating a removed file that will never be written * we don't need to journal the block frees. The canceled journals @@ -6346,7 +6413,7 @@ softdep_journal_freeblocks(ip, cred, length, flags needj = 0; CTR3(KTR_SUJ, "softdep_journal_freeblks: ip %d length %ld needj %d", ip->i_number, length, needj); - FREE_LOCK(&lk); + FREE_LOCK(ump); /* * Calculate the lbn that we are truncating to. This results in -1 * if we're truncating the 0 bytes. So it is the last lbn we want @@ -6405,7 +6472,7 @@ softdep_journal_freeblocks(ip, cred, length, flags oldfrags -= frags; oldfrags = numfrags(ip->i_fs, oldfrags); blkno += numfrags(ip->i_fs, frags); - newfreework(ip->i_ump, freeblks, NULL, lastlbn, + newfreework(ump, freeblks, NULL, lastlbn, blkno, oldfrags, 0, needj); } else if (blkno == 0) allocblock = 1; @@ -6438,9 +6505,9 @@ softdep_journal_freeblocks(ip, cred, length, flags (void) chkdq(ip, -datablocks, NOCRED, 0); #endif freeblks->fb_chkcnt = -datablocks; - UFS_LOCK(ip->i_ump); + UFS_LOCK(ump); fs->fs_pendingblocks += datablocks; - UFS_UNLOCK(ip->i_ump); + UFS_UNLOCK(ump); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - datablocks); /* * Handle truncation of incomplete alloc direct dependencies. We @@ -6460,13 +6527,13 @@ softdep_journal_freeblocks(ip, cred, length, flags if (bp->b_bufsize == fs->fs_bsize) bp->b_flags |= B_CLUSTEROK; softdep_update_inodeblock(ip, bp, 0); - if (ip->i_ump->um_fstype == UFS1) + if (ump->um_fstype == UFS1) *((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ip->i_number)) = *ip->i_din1; else *((struct ufs2_dinode *)bp->b_data + ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); (void) inodedep_lookup(mp, ip->i_number, dflags, &inodedep); if ((inodedep->id_state & IOSTARTED) != 0) panic("softdep_setup_freeblocks: inode busy"); @@ -6518,7 +6585,7 @@ softdep_journal_freeblocks(ip, cred, length, flags */ LIST_FOREACH(jblkdep, &freeblks->fb_jblkdephd, jb_deps) add_to_journal(&jblkdep->jb_list); - FREE_LOCK(&lk); + FREE_LOCK(ump); bdwrite(bp); /* * Truncate dependency structures beyond length. @@ -6559,7 +6626,7 @@ softdep_journal_freeblocks(ip, cred, length, flags bawrite(bp); } - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); inodedep_lookup(mp, ip->i_number, dflags, &inodedep); TAILQ_INSERT_TAIL(&inodedep->id_freeblklst, freeblks, fb_next); freeblks->fb_state |= DEPCOMPLETE | ONDEPLIST; @@ -6575,7 +6642,7 @@ softdep_journal_freeblocks(ip, cred, length, flags freeblks->fb_state |= INPROGRESS; else freeblks = NULL; - FREE_LOCK(&lk); + FREE_LOCK(ump); if (freeblks) handle_workitem_freeblocks(freeblks, 0); trunc_pages(ip, length, extblocks, flags); @@ -6591,6 +6658,8 @@ softdep_journal_fsync(ip) { struct jfsync *jfsync; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_journal_fsync called on non-softdep filesystem")); if ((ip->i_flag & IN_TRUNCATED) == 0) return; ip->i_flag &= ~IN_TRUNCATED; @@ -6598,10 +6667,10 @@ softdep_journal_fsync(ip) workitem_alloc(&jfsync->jfs_list, D_JFSYNC, UFSTOVFS(ip->i_ump)); jfsync->jfs_size = ip->i_size; jfsync->jfs_ino = ip->i_number; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); add_to_journal(&jfsync->jfs_list); jwait(&jfsync->jfs_list, MNT_WAIT); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); } /* @@ -6644,6 +6713,7 @@ softdep_setup_freeblocks(ip, length, flags) struct freeblks *freeblks; struct inodedep *inodedep; struct allocdirect *adp; + struct ufsmount *ump; struct buf *bp; struct fs *fs; ufs2_daddr_t extblocks, datablocks; @@ -6652,12 +6722,14 @@ softdep_setup_freeblocks(ip, length, flags) ufs_lbn_t tmpval; ufs_lbn_t lbn; + ump = ip->i_ump; + mp = UFSTOVFS(ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_freeblocks called on non-softdep filesystem")); CTR2(KTR_SUJ, "softdep_setup_freeblks: ip %d length %ld", ip->i_number, length); + KASSERT(length == 0, ("softdep_setup_freeblocks: non-zero length")); fs = ip->i_fs; - mp = UFSTOVFS(ip->i_ump); - if (length != 0) - panic("softdep_setup_freeblocks: non-zero length"); freeblks = newfreeblks(mp, ip); extblocks = 0; datablocks = 0; @@ -6685,9 +6757,9 @@ softdep_setup_freeblocks(ip, length, flags) (void) chkdq(ip, -datablocks, NOCRED, 0); #endif freeblks->fb_chkcnt = -datablocks; - UFS_LOCK(ip->i_ump); + UFS_LOCK(ump); fs->fs_pendingblocks += datablocks; - UFS_UNLOCK(ip->i_ump); + UFS_UNLOCK(ump); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - datablocks); /* * Push the zero'ed inode to to its disk buffer so that we are free @@ -6700,7 +6772,7 @@ softdep_setup_freeblocks(ip, length, flags) brelse(bp); softdep_error("softdep_setup_freeblocks", error); } - if (ip->i_ump->um_fstype == UFS1) { + if (ump->um_fstype == UFS1) { dp1 = ((struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, ip->i_number)); ip->i_din1->di_freelink = dp1->di_freelink; @@ -6714,7 +6786,7 @@ softdep_setup_freeblocks(ip, length, flags) /* * Find and eliminate any inode dependencies. */ - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); dflags = DEPALLOC; if (IS_SNAPSHOT(ip)) dflags |= NODELAY; @@ -6756,10 +6828,10 @@ softdep_setup_freeblocks(ip, length, flags) cancel_allocdirect(&inodedep->id_extupdt, adp, freeblks); } - FREE_LOCK(&lk); + FREE_LOCK(ump); bdwrite(bp); trunc_dependencies(ip, freeblks, -1, 0, flags); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) != 0) (void) free_inodedep(inodedep); freeblks->fb_state |= DEPCOMPLETE; @@ -6771,7 +6843,7 @@ softdep_setup_freeblocks(ip, length, flags) freeblks->fb_state |= INPROGRESS; else freeblks = NULL; - FREE_LOCK(&lk); + FREE_LOCK(ump); if (freeblks) handle_workitem_freeblocks(freeblks, 0); trunc_pages(ip, length, extblocks, flags); @@ -6908,6 +6980,7 @@ restart: bp->b_vflags |= BV_SCANNED; continue; } + KASSERT(bp->b_bufobj == bo, ("Wrong object in buffer")); if ((bp = getdirtybuf(bp, BO_LOCKPTR(bo), MNT_WAIT)) == NULL) goto restart; BO_UNLOCK(bo); @@ -7045,8 +7118,12 @@ deallocate_dependencies(bp, freeblks, off) struct pagedep *pagedep; struct allocdirect *adp; struct worklist *wk, *wkn; + struct ufsmount *ump; - ACQUIRE_LOCK(&lk); + if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) + goto done; + ump = VFSTOUFS(wk->wk_mp); + ACQUIRE_LOCK(ump); LIST_FOREACH_SAFE(wk, &bp->b_dep, wk_list, wkn) { switch (wk->wk_type) { case D_INDIRDEP: @@ -7060,7 +7137,7 @@ deallocate_dependencies(bp, freeblks, off) case D_PAGEDEP: pagedep = WK_PAGEDEP(wk); if (cancel_pagedep(pagedep, freeblks, off)) { - FREE_LOCK(&lk); + FREE_LOCK(ump); return (ERESTART); } continue; @@ -7096,7 +7173,8 @@ deallocate_dependencies(bp, freeblks, off) /* NOTREACHED */ } } - FREE_LOCK(&lk); + FREE_LOCK(ump); +done: /* * Don't throw away this buf, we were partially truncating and * some deps may always remain. @@ -7254,7 +7332,7 @@ free_newblk(newblk) ("free_newblk: jnewblk %p still attached", newblk->nb_jnewblk)); KASSERT(newblk->nb_list.wk_type != D_NEWBLK, ("free_newblk: unclaimed newblk")); - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(VFSTOUFS(newblk->nb_list.wk_mp)); newblk_freefrag(newblk); if (newblk->nb_state & ONDEPLIST) LIST_REMOVE(newblk, nb_deps); @@ -7283,7 +7361,7 @@ free_newdirblk(newdirblk) struct diradd *dap; struct worklist *wk; - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(VFSTOUFS(newdirblk->db_list.wk_mp)); WORKLIST_REMOVE(&newdirblk->db_list); /* * If the pagedep is still linked onto the directory buffer @@ -7327,7 +7405,11 @@ softdep_freefile(pvp, ino, mode) struct inodedep *inodedep; struct freefile *freefile; struct freeblks *freeblks; + struct ufsmount *ump; + ump = ip->i_ump; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0, + ("softdep_freefile called on non-softdep filesystem")); /* * This sets up the inode de-allocation dependency. */ @@ -7338,9 +7420,9 @@ softdep_freefile(pvp, ino, mode) freefile->fx_oldinum = ino; freefile->fx_devvp = ip->i_devvp; LIST_INIT(&freefile->fx_jwork); - UFS_LOCK(ip->i_ump); + UFS_LOCK(ump); ip->i_fs->fs_pendinginodes += 1; - UFS_UNLOCK(ip->i_ump); + UFS_UNLOCK(ump); /* * If the inodedep does not exist, then the zero'ed inode has @@ -7353,7 +7435,7 @@ softdep_freefile(pvp, ino, mode) * Any blocks waiting on the inode to write can be safely freed * here as it will never been written. */ - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); inodedep_lookup(pvp->v_mount, ino, 0, &inodedep); if (inodedep) { /* @@ -7377,12 +7459,15 @@ softdep_freefile(pvp, ino, mode) */ handle_bufwait(inodedep, &freefile->fx_jwork); clear_unlinked_inodedep(inodedep); - /* Re-acquire inodedep as we've dropped lk. */ + /* + * Re-acquire inodedep as we've dropped the + * per-filesystem lock in clear_unlinked_inodedep(). + */ inodedep_lookup(pvp->v_mount, ino, 0, &inodedep); } } if (inodedep == NULL || check_inode_unwritten(inodedep)) { - FREE_LOCK(&lk); + FREE_LOCK(ump); handle_workitem_freefile(freefile); return; } @@ -7389,7 +7474,7 @@ softdep_freefile(pvp, ino, mode) if ((inodedep->id_state & DEPCOMPLETE) == 0) inodedep->id_state |= GOINGAWAY; WORKLIST_INSERT(&inodedep->id_inowait, &freefile->fx_list); - FREE_LOCK(&lk); + FREE_LOCK(ump); if (ip->i_number == ino) ip->i_flag |= IN_MODIFIED; } @@ -7414,7 +7499,7 @@ check_inode_unwritten(inodedep) struct inodedep *inodedep; { - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(VFSTOUFS(inodedep->id_list.wk_mp)); if ((inodedep->id_state & (DEPCOMPLETE | UNLINKED)) != 0 || !LIST_EMPTY(&inodedep->id_dirremhd) || @@ -7462,7 +7547,7 @@ free_inodedep(inodedep) struct inodedep *inodedep; { - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(VFSTOUFS(inodedep->id_list.wk_mp)); if ((inodedep->id_state & (ONWORKLIST | UNLINKED)) != 0 || (inodedep->id_state & ALLCOMPLETE) != ALLCOMPLETE || !LIST_EMPTY(&inodedep->id_dirremhd) || @@ -7505,7 +7590,8 @@ freework_freeblock(freework) int bsize; int needj; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(freework->fw_list.wk_mp); + LOCK_OWNED(ump); /* * Handle partial truncate separately. */ @@ -7514,7 +7600,6 @@ freework_freeblock(freework) return; } freeblks = freework->fw_freeblks; - ump = VFSTOUFS(freeblks->fb_list.wk_mp); fs = ump->um_fs; needj = MOUNTEDSUJ(freeblks->fb_list.wk_mp) != 0; bsize = lfragtosize(fs, freework->fw_frags); @@ -7546,7 +7631,7 @@ freework_freeblock(freework) freeblks->fb_cgwait++; WORKLIST_INSERT(&wkhd, &freework->fw_list); } - FREE_LOCK(&lk); + FREE_LOCK(ump); freeblks_free(ump, freeblks, btodb(bsize)); CTR4(KTR_SUJ, "freework_freeblock: ino %d blkno %jd lbn %jd size %ld", @@ -7553,7 +7638,7 @@ freework_freeblock(freework) freeblks->fb_inum, freework->fw_blkno, freework->fw_lbn, bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno, bsize, freeblks->fb_inum, freeblks->fb_vtype, &wkhd); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); /* * The jnewblk will be discarded and the bits in the map never * made it to disk. We can immediately free the freeblk. @@ -7609,10 +7694,10 @@ handle_workitem_indirblk(freework) return; } freework->fw_state |= INPROGRESS; - FREE_LOCK(&lk); + FREE_LOCK(ump); indir_trunc(freework, fsbtodb(fs, freework->fw_blkno), freework->fw_lbn); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } /* @@ -7668,7 +7753,7 @@ handle_workitem_freeblocks(freeblks, flags) KASSERT(LIST_EMPTY(&freeblks->fb_jblkdephd), ("handle_workitem_freeblocks: Journal entries not written.")); ump = VFSTOUFS(freeblks->fb_list.wk_mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); while ((wk = LIST_FIRST(&freeblks->fb_freeworkhd)) != NULL) { WORKLIST_REMOVE(wk); switch (wk->wk_type) { @@ -7685,11 +7770,11 @@ handle_workitem_freeblocks(freeblks, flags) aip = WK_ALLOCINDIR(wk); freework = NULL; if (aip->ai_state & DELAYEDFREE) { - FREE_LOCK(&lk); + FREE_LOCK(ump); freework = newfreework(ump, freeblks, NULL, aip->ai_lbn, aip->ai_newblkno, ump->um_fs->fs_frag, 0, 0); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } newblk = WK_NEWBLK(wk); if (newblk->nb_jnewblk) { @@ -7717,7 +7802,7 @@ handle_workitem_freeblocks(freeblks, flags) wake_worklist(&freeblks->fb_list); freeblks = NULL; } - FREE_LOCK(&lk); + FREE_LOCK(ump); if (freeblks) return handle_complete_freeblocks(freeblks, flags); return (0); @@ -7804,7 +7889,7 @@ handle_complete_freeblocks(freeblks, flags) quotaadj(freeblks->fb_quota, ump, -spare); quotarele(freeblks->fb_quota); #endif - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (freeblks->fb_state & ONDEPLIST) { inodedep_lookup(freeblks->fb_list.wk_mp, freeblks->fb_inum, 0, &inodedep); @@ -7819,7 +7904,7 @@ handle_complete_freeblocks(freeblks, flags) */ handle_jwork(&freeblks->fb_jwork); WORKITEM_FREE(freeblks, D_FREEBLKS); - FREE_LOCK(&lk); + FREE_LOCK(ump); return (0); } @@ -7898,7 +7983,7 @@ indir_trunc(freework, dbn, lbn) brelse(bp); return; } - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); /* Protects against a race with complete_trunc_indir(). */ freework->fw_state &= ~INPROGRESS; /* @@ -7915,7 +8000,7 @@ indir_trunc(freework, dbn, lbn) if (freework->fw_indir == NULL) TAILQ_INSERT_TAIL(&indirdep->ir_trunc, freework, fw_next); - FREE_LOCK(&lk); + FREE_LOCK(ump); return; } /* @@ -7924,10 +8009,10 @@ indir_trunc(freework, dbn, lbn) */ if (goingaway) { free_indirdep(indirdep); - ump->um_numindirdeps -= 1; + ump->softdep_numindirdeps -= 1; } } - FREE_LOCK(&lk); + FREE_LOCK(ump); /* Initialize pointers depending on block size. */ if (ump->um_fstype == UFS1) { bap1 = (ufs1_daddr_t *)bp->b_data; @@ -8007,7 +8092,7 @@ indir_trunc(freework, dbn, lbn) * indirect can be completed when its children are free. */ if (needj) { - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); freework->fw_off = i; freework->fw_ref += freedeps; freework->fw_ref -= NINDIR(fs) + 1; @@ -8015,7 +8100,7 @@ indir_trunc(freework, dbn, lbn) freeblks->fb_cgwait += freedeps; if (freework->fw_ref == 0) freework_freeblock(freework); - FREE_LOCK(&lk); + FREE_LOCK(ump); return; } /* @@ -8030,9 +8115,9 @@ indir_trunc(freework, dbn, lbn) /* Non SUJ softdep does single-threaded truncations. */ if (freework->fw_blkno == dbn) { freework->fw_state |= ALLCOMPLETE; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); handle_written_freework(freework); - FREE_LOCK(&lk); + FREE_LOCK(ump); } return; } @@ -8097,7 +8182,8 @@ cancel_allocindir(aip, bp, freeblks, trunc) * Create the mkdir dependencies for . and .. in a new directory. Link them * in to a newdirblk so any subsequent additions are tracked properly. The * caller is responsible for adding the mkdir1 dependency to the journal - * and updating id_mkdiradd. This function returns with lk held. + * and updating id_mkdiradd. This function returns with the per-filesystem + * lock held. */ static struct mkdir * setup_newdir(dap, newinum, dinum, newdirbp, mkdirp) @@ -8114,9 +8200,11 @@ setup_newdir(dap, newinum, dinum, newdirbp, mkdirp struct mkdir *mkdir1, *mkdir2; struct worklist *wk; struct jaddref *jaddref; + struct ufsmount *ump; struct mount *mp; mp = dap->da_list.wk_mp; + ump = VFSTOUFS(mp); newdirblk = malloc(sizeof(struct newdirblk), M_NEWDIRBLK, M_SOFTDEP_FLAGS); workitem_alloc(&newdirblk->db_list, D_NEWDIRBLK, mp); @@ -8139,8 +8227,8 @@ setup_newdir(dap, newinum, dinum, newdirbp, mkdirp * Dependency on "." and ".." being written to disk. */ mkdir1->md_buf = newdirbp; - ACQUIRE_LOCK(&lk); - LIST_INSERT_HEAD(&mkdirlisthd, mkdir1, md_mkdirs); + ACQUIRE_LOCK(VFSTOUFS(mp)); + LIST_INSERT_HEAD(&ump->softdep_mkdirlisthd, mkdir1, md_mkdirs); /* * We must link the pagedep, allocdirect, and newdirblk for * the initial file page so the pointer to the new directory @@ -8179,7 +8267,7 @@ setup_newdir(dap, newinum, dinum, newdirbp, mkdirp KASSERT(jaddref != NULL && jaddref->ja_parent == newinum && (jaddref->ja_state & MKDIR_PARENT), ("setup_newdir: bad dotdot jaddref %p", jaddref)); - LIST_INSERT_HEAD(&mkdirlisthd, mkdir2, md_mkdirs); + LIST_INSERT_HEAD(&ump->softdep_mkdirlisthd, mkdir2, md_mkdirs); mkdir2->md_jaddref = jaddref; jaddref->ja_mkdir = mkdir2; } else if (inodedep == NULL || @@ -8188,7 +8276,7 @@ setup_newdir(dap, newinum, dinum, newdirbp, mkdirp WORKITEM_FREE(mkdir2, D_MKDIR); mkdir2 = NULL; } else { - LIST_INSERT_HEAD(&mkdirlisthd, mkdir2, md_mkdirs); + LIST_INSERT_HEAD(&ump->softdep_mkdirlisthd, mkdir2, md_mkdirs); WORKLIST_INSERT(&inodedep->id_bufwait, &mkdir2->md_list); } *mkdirp = mkdir2; @@ -8238,9 +8326,14 @@ softdep_setup_directory_add(bp, dp, diroffset, new struct newdirblk *newdirblk = 0; struct mkdir *mkdir1, *mkdir2; struct jaddref *jaddref; + struct ufsmount *ump; struct mount *mp; int isindir; + ump = dp->i_ump; + mp = UFSTOVFS(ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_directory_add called on non-softdep filesystem")); /* * Whiteouts have no dependencies. */ @@ -8251,7 +8344,6 @@ softdep_setup_directory_add(bp, dp, diroffset, new } jaddref = NULL; mkdir1 = mkdir2 = NULL; - mp = UFSTOVFS(dp->i_ump); fs = dp->i_fs; lbn = lblkno(fs, diroffset); offset = blkoff(fs, diroffset); @@ -8277,7 +8369,7 @@ softdep_setup_directory_add(bp, dp, diroffset, new */ if (newdirbp == NULL) { dap->da_state |= DEPCOMPLETE; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } else { dap->da_state |= MKDIR_BODY | MKDIR_PARENT; mkdir1 = setup_newdir(dap, newinum, dp->i_number, newdirbp, @@ -8360,7 +8452,7 @@ softdep_setup_directory_add(bp, dp, diroffset, new */ if ((pagedep->pd_state & NEWBLOCK) != 0) { WORKITEM_FREE(newdirblk, D_NEWDIRBLK); - FREE_LOCK(&lk); + FREE_LOCK(ump); return (0); } if (newblk_lookup(mp, dbtofsb(fs, bp->b_blkno), 0, &newblk) @@ -8370,7 +8462,7 @@ softdep_setup_directory_add(bp, dp, diroffset, new pagedep->pd_state |= NEWBLOCK; pagedep->pd_newdirblk = newdirblk; newdirblk->db_pagedep = pagedep; - FREE_LOCK(&lk); + FREE_LOCK(ump); /* * If we extended into an indirect signal direnter to sync. */ @@ -8378,7 +8470,7 @@ softdep_setup_directory_add(bp, dp, diroffset, new return (1); return (0); } - FREE_LOCK(&lk); + FREE_LOCK(ump); return (0); } @@ -8408,6 +8500,9 @@ softdep_change_directoryentry_offset(bp, dp, base, int flags; mp = UFSTOVFS(dp->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_change_directoryentry_offset called on " + "non-softdep filesystem")); de = (struct direct *)oldloc; jmvref = NULL; flags = 0; @@ -8426,7 +8521,7 @@ softdep_change_directoryentry_offset(bp, dp, base, offset = blkoff(dp->i_fs, dp->i_offset); oldoffset = offset + (oldloc - base); newoffset = offset + (newloc - base); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(dp->i_ump); if (pagedep_lookup(mp, bp, dp->i_number, lbn, flags, &pagedep) == 0) goto done; dap = diradd_lookup(pagedep, oldoffset); @@ -8448,7 +8543,7 @@ done: add_to_journal(&jmvref->jm_list); } bcopy(oldloc, newloc, entrysize); - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -8464,6 +8559,7 @@ merge_diradd(inodedep, newdap) { struct diradd *olddap; struct mkdir *mkdir, *nextmd; + struct ufsmount *ump; short state; olddap = inodedep->id_mkdiradd; @@ -8470,7 +8566,9 @@ merge_diradd(inodedep, newdap) inodedep->id_mkdiradd = newdap; if ((olddap->da_state & (MKDIR_PARENT | MKDIR_BODY)) != 0) { newdap->da_state &= ~DEPCOMPLETE; - for (mkdir = LIST_FIRST(&mkdirlisthd); mkdir; mkdir = nextmd) { + ump = VFSTOUFS(inodedep->id_list.wk_mp); + for (mkdir = LIST_FIRST(&ump->softdep_mkdirlisthd); mkdir; + mkdir = nextmd) { nextmd = LIST_NEXT(mkdir, md_mkdirs); if (mkdir->md_diradd != olddap) continue; @@ -8529,6 +8627,7 @@ cancel_diradd(dap, dirrem, jremref, dotremref, dot struct inodedep *inodedep; struct jaddref *jaddref; struct inoref *inoref; + struct ufsmount *ump; struct mkdir *mkdir; /* @@ -8565,7 +8664,8 @@ cancel_diradd(dap, dirrem, jremref, dotremref, dot * journaling. */ if ((dap->da_state & (MKDIR_PARENT | MKDIR_BODY)) != 0) { - LIST_FOREACH(mkdir, &mkdirlisthd, md_mkdirs) { + ump = VFSTOUFS(dap->da_list.wk_mp); + LIST_FOREACH(mkdir, &ump->softdep_mkdirlisthd, md_mkdirs) { if (mkdir->md_diradd != dap) continue; if ((jaddref = mkdir->md_jaddref) == NULL) @@ -8610,8 +8710,10 @@ free_diradd(dap, wkhd) struct pagedep *pagedep; struct inodedep *inodedep; struct mkdir *mkdir, *nextmd; + struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(dap->da_list.wk_mp); + LOCK_OWNED(ump); LIST_REMOVE(dap, da_pdlist); if (dap->da_state & ONWORKLIST) WORKLIST_REMOVE(&dap->da_list); @@ -8630,7 +8732,8 @@ free_diradd(dap, wkhd) if (inodedep->id_mkdiradd == dap) inodedep->id_mkdiradd = NULL; if ((dap->da_state & (MKDIR_PARENT | MKDIR_BODY)) != 0) { - for (mkdir = LIST_FIRST(&mkdirlisthd); mkdir; mkdir = nextmd) { + for (mkdir = LIST_FIRST(&ump->softdep_mkdirlisthd); mkdir; + mkdir = nextmd) { nextmd = LIST_NEXT(mkdir, md_mkdirs); if (mkdir->md_diradd != dap) continue; @@ -8685,6 +8788,8 @@ softdep_setup_remove(bp, dp, ip, isrmdir) struct inodedep *inodedep; int direct; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_setup_remove called on non-softdep filesystem")); /* * Allocate a new dirrem if appropriate and ACQUIRE_LOCK. We want * newdirrem() to setup the full directory remove which requires @@ -8716,7 +8821,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir) if ((dirrem->dm_state & COMPLETE) == 0) { LIST_INSERT_HEAD(&dirrem->dm_pagedep->pd_dirremhd, dirrem, dm_next); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); } else { if (prevdirrem != NULL) LIST_INSERT_HEAD(&dirrem->dm_pagedep->pd_dirremhd, @@ -8723,7 +8828,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir) prevdirrem, dm_next); dirrem->dm_dirinum = dirrem->dm_pagedep->pd_ino; direct = LIST_EMPTY(&dirrem->dm_jremrefhd); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); if (direct) handle_workitem_remove(dirrem, 0); } @@ -8795,6 +8900,7 @@ cancel_mkdir_dotdot(ip, dirrem, jremref) { struct inodedep *inodedep; struct jaddref *jaddref; + struct ufsmount *ump; struct mkdir *mkdir; struct diradd *dap; @@ -8804,7 +8910,8 @@ cancel_mkdir_dotdot(ip, dirrem, jremref) dap = inodedep->id_mkdiradd; if (dap == NULL || (dap->da_state & MKDIR_PARENT) == 0) return (jremref); - for (mkdir = LIST_FIRST(&mkdirlisthd); mkdir; + ump = VFSTOUFS(inodedep->id_list.wk_mp); + for (mkdir = LIST_FIRST(&ump->softdep_mkdirlisthd); mkdir; mkdir = LIST_NEXT(mkdir, md_mkdirs)) if (mkdir->md_diradd == dap && mkdir->md_state & MKDIR_PARENT) break; @@ -8897,10 +9004,10 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp) * Limiting the number of dirrem structures will also limit * the number of freefile and freeblks structures. */ - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); if (!IS_SNAPSHOT(ip) && dep_current[D_DIRREM] > max_softdeps / 2) (void) request_cleanup(ITOV(dp)->v_mount, FLUSH_BLOCKS); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); dirrem = malloc(sizeof(struct dirrem), M_DIRREM, M_SOFTDEP_FLAGS|M_ZERO); workitem_alloc(&dirrem->dm_list, D_DIRREM, dvp->v_mount); @@ -8930,7 +9037,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp) jremref = newjremref(dirrem, dp, ip, dp->i_offset, ip->i_effnlink + 1); } - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); lbn = lblkno(dp->i_fs, dp->i_offset); offset = blkoff(dp->i_fs, dp->i_offset); pagedep_lookup(UFSTOVFS(dp->i_ump), bp, dp->i_number, lbn, DEPALLOC, @@ -9043,6 +9150,8 @@ softdep_setup_directory_change(bp, dp, ip, newinum offset = blkoff(dp->i_fs, dp->i_offset); mp = UFSTOVFS(dp->i_ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_directory_change called on non-softdep filesystem")); /* * Whiteouts do not need diradd dependencies. @@ -9090,7 +9199,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum if (LIST_EMPTY(&dirrem->dm_jremrefhd)) add_to_worklist(&dirrem->dm_list, 0); } - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); return; } /* @@ -9164,7 +9273,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum */ if (inodedep->id_mkdiradd && dp->i_offset != DOTDOT_OFFSET) merge_diradd(inodedep, dap); - FREE_LOCK(&lk); + FREE_LOCK(dp->i_ump); } /* @@ -9180,7 +9289,9 @@ softdep_change_linkcnt(ip) struct inodedep *inodedep; int dflags; - ACQUIRE_LOCK(&lk); + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_change_linkcnt called on non-softdep filesystem")); + ACQUIRE_LOCK(ip->i_ump); dflags = DEPALLOC; if (IS_SNAPSHOT(ip)) dflags |= NODELAY; @@ -9188,7 +9299,7 @@ softdep_change_linkcnt(ip) if (ip->i_nlink < ip->i_effnlink) panic("softdep_change_linkcnt: bad delta"); inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink; - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); } /* @@ -9204,8 +9315,8 @@ softdep_setup_sbupdate(ump, fs, bp) struct sbdep *sbdep; struct worklist *wk; - if (MOUNTEDSUJ(UFSTOVFS(ump)) == 0) - return; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0, + ("softdep_setup_sbupdate called on non-softdep filesystem")); LIST_FOREACH(wk, &bp->b_dep, wk_list) if (wk->wk_type == D_SBDEP) break; @@ -9215,9 +9326,9 @@ softdep_setup_sbupdate(ump, fs, bp) workitem_alloc(&sbdep->sb_list, D_SBDEP, UFSTOVFS(ump)); sbdep->sb_fs = fs; sbdep->sb_ump = ump; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); WORKLIST_INSERT(&bp->b_dep, &sbdep->sb_list); - FREE_LOCK(&lk); + FREE_LOCK(ump); } /* @@ -9231,7 +9342,7 @@ first_unlinked_inodedep(ump) struct inodedep *inodedep; struct inodedep *idp; - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(ump); for (inodedep = TAILQ_LAST(&ump->softdep_unlinked, inodedeplst); inodedep; inodedep = idp) { if ((inodedep->id_state & UNLINKNEXT) == 0) @@ -9280,7 +9391,7 @@ handle_written_sbdep(sbdep, bp) struct mount *mp; struct fs *fs; - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(sbdep->sb_ump); fs = sbdep->sb_fs; mp = UFSTOVFS(sbdep->sb_ump); /* @@ -9322,10 +9433,10 @@ unlinked_inodedep(mp, inodedep) { struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); if (MOUNTEDSUJ(mp) == 0) return; - ump = VFSTOUFS(mp); ump->um_fs->fs_fmod = 1; if (inodedep->id_state & UNLINKED) panic("unlinked_inodedep: %p already unlinked\n", inodedep); @@ -9356,7 +9467,7 @@ clear_unlinked_inodedep(inodedep) ino = inodedep->id_ino; error = 0; for (;;) { - rw_assert(&lk, RA_WLOCKED); + LOCK_OWNED(ump); KASSERT((inodedep->id_state & UNLINKED) != 0, ("clear_unlinked_inodedep: inodedep %p not unlinked", inodedep)); @@ -9394,7 +9505,7 @@ clear_unlinked_inodedep(inodedep) pino = 0; if (idp && (idp->id_state & UNLINKNEXT)) pino = idp->id_ino; - FREE_LOCK(&lk); + FREE_LOCK(ump); if (pino == 0) { bp = getblk(ump->um_devvp, btodb(fs->fs_sblockloc), (int)fs->fs_sbsize, 0, 0, 0); @@ -9405,7 +9516,7 @@ clear_unlinked_inodedep(inodedep) if (error) brelse(bp); } - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (error) break; /* If the list has changed restart the loop. */ @@ -9415,9 +9526,9 @@ clear_unlinked_inodedep(inodedep) nino = idp->id_ino; if (nino != pino || (inodedep->id_state & UNLINKPREV) != UNLINKPREV) { - FREE_LOCK(&lk); + FREE_LOCK(ump); brelse(bp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); continue; } nino = 0; @@ -9433,7 +9544,7 @@ clear_unlinked_inodedep(inodedep) inodedep)); inodedep->id_state &= ~(UNLINKED | UNLINKLINKS | UNLINKONLIST); TAILQ_REMOVE(&ump->softdep_unlinked, inodedep, id_unlinked); - FREE_LOCK(&lk); + FREE_LOCK(ump); /* * The predecessor's next pointer is manually updated here * so that the NEXT flag is never cleared for an element @@ -9455,13 +9566,13 @@ clear_unlinked_inodedep(inodedep) * filesystem is corrupted already. */ bwrite(bp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); /* * If the superblock pointer still needs to be cleared force * a write here. */ if (fs->fs_sujfree == ino) { - FREE_LOCK(&lk); + FREE_LOCK(ump); bp = getblk(ump->um_devvp, btodb(fs->fs_sblockloc), (int)fs->fs_sbsize, 0, 0, 0); bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize); @@ -9469,7 +9580,7 @@ clear_unlinked_inodedep(inodedep) softdep_setup_sbupdate(ump, (struct fs *)bp->b_data, bp); bwrite(bp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } if (fs->fs_sujfree != ino) @@ -9511,7 +9622,7 @@ handle_workitem_remove(dirrem, flags) if (ffs_vgetf(mp, oldinum, flags, &vp, FFSV_FORCEINSMQ) != 0) return (EBUSY); ip = VTOI(vp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if ((inodedep_lookup(mp, oldinum, 0, &inodedep)) == 0) panic("handle_workitem_remove: lost inodedep"); if (dirrem->dm_state & ONDEPLIST) @@ -9553,7 +9664,7 @@ handle_workitem_remove(dirrem, flags) ("handle_workitem_remove: worklist not empty. %s", TYPENAME(LIST_FIRST(&dirrem->dm_jwork)->wk_type))); WORKITEM_FREE(dirrem, D_DIRREM); - FREE_LOCK(&lk); + FREE_LOCK(ump); goto out; } /* @@ -9579,7 +9690,7 @@ handle_workitem_remove(dirrem, flags) KASSERT(LIST_EMPTY(&dirrem->dm_jwork), ("handle_workitem_remove: DIRCHG and worklist not empty.")); WORKITEM_FREE(dirrem, D_DIRREM); - FREE_LOCK(&lk); + FREE_LOCK(ump); goto out; } dirrem->dm_state = ONDEPLIST; @@ -9600,12 +9711,12 @@ handle_workitem_remove(dirrem, flags) if (inodedep == NULL || (inodedep->id_state & (DEPCOMPLETE | UNLINKED)) == UNLINKED || check_inode_unwritten(inodedep)) { - FREE_LOCK(&lk); + FREE_LOCK(ump); vput(vp); return handle_workitem_remove(dirrem, flags); } WORKLIST_INSERT(&inodedep->id_inowait, &dirrem->dm_list); - FREE_LOCK(&lk); + FREE_LOCK(ump); ip->i_flag |= IN_CHANGE; out: ffs_update(vp, 0); @@ -9640,9 +9751,9 @@ handle_workitem_freefile(freefile) ump = VFSTOUFS(freefile->fx_list.wk_mp); fs = ump->um_fs; #ifdef DEBUG - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); error = inodedep_lookup(UFSTOVFS(ump), freefile->fx_oldinum, 0, &idp); - FREE_LOCK(&lk); + FREE_LOCK(ump); if (error) panic("handle_workitem_freefile: inodedep %p survived", idp); #endif @@ -9654,9 +9765,9 @@ handle_workitem_freefile(freefile) if ((error = ffs_freefile(ump, fs, freefile->fx_devvp, freefile->fx_oldinum, freefile->fx_mode, &wkhd)) != 0) softdep_error("handle_workitem_freefile", error); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); WORKITEM_FREE(freefile, D_FREEFILE); - FREE_LOCK(&lk); + FREE_LOCK(ump); } @@ -9706,6 +9817,7 @@ softdep_disk_io_initiation(bp) struct freeblks *freeblks; struct jblkdep *jblkdep; struct newblk *newblk; + struct ufsmount *ump; /* * We only care about write operations. There should never @@ -9718,10 +9830,13 @@ softdep_disk_io_initiation(bp) panic("softdep_disk_io_initiation: Writing buffer with " "background write in progress: %p", bp); + if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) + return; + ump = VFSTOUFS(wk->wk_mp); + marker.wk_type = D_LAST + 1; /* Not a normal workitem */ PHOLD(curproc); /* Don't swap out kernel stack */ - - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); /* * Do any necessary pre-I/O processing. */ @@ -9805,7 +9920,7 @@ softdep_disk_io_initiation(bp) /* NOTREACHED */ } } - FREE_LOCK(&lk); + FREE_LOCK(ump); PRELE(curproc); /* Allow swapout of kernel stack */ } @@ -9841,8 +9956,8 @@ initiate_write_filepage(pagedep, bp) * Wait for all journal remove dependencies to hit the disk. * We can not allow any potentially conflicting directory adds * to be visible before removes and rollback is too difficult. - * lk may be dropped and re-acquired, however we hold the buf - * locked so the dependency can not go away. + * The per-filesystem lock may be dropped and re-acquired, however + * we hold the buf locked so the dependency can not go away. */ LIST_FOREACH(dirrem, &pagedep->pd_dirremhd, dm_next) while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) != NULL) @@ -9887,6 +10002,7 @@ initiate_write_inodeblock_ufs1(inodedep, bp) struct ufs1_dinode *dp; struct ufs1_dinode *sip; struct inoref *inoref; + struct ufsmount *ump; struct fs *fs; ufs_lbn_t i; #ifdef INVARIANTS @@ -9898,6 +10014,8 @@ initiate_write_inodeblock_ufs1(inodedep, bp) panic("initiate_write_inodeblock_ufs1: already started"); inodedep->id_state |= IOSTARTED; fs = inodedep->id_fs; + ump = VFSTOUFS(inodedep->id_list.wk_mp); + LOCK_OWNED(ump); dp = (struct ufs1_dinode *)bp->b_data + ino_to_fsbo(fs, inodedep->id_ino); @@ -9918,10 +10036,10 @@ initiate_write_inodeblock_ufs1(inodedep, bp) if ((inodedep->id_state & DEPCOMPLETE) == 0) { if (inodedep->id_savedino1 != NULL) panic("initiate_write_inodeblock_ufs1: I/O underway"); - FREE_LOCK(&lk); + FREE_LOCK(ump); sip = malloc(sizeof(struct ufs1_dinode), M_SAVEDINO, M_SOFTDEP_FLAGS); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); inodedep->id_savedino1 = sip; *inodedep->id_savedino1 = *dp; bzero((caddr_t)dp, sizeof(struct ufs1_dinode)); @@ -10054,6 +10172,7 @@ initiate_write_inodeblock_ufs2(inodedep, bp) struct ufs2_dinode *dp; struct ufs2_dinode *sip; struct inoref *inoref; + struct ufsmount *ump; struct fs *fs; ufs_lbn_t i; #ifdef INVARIANTS @@ -10065,6 +10184,8 @@ initiate_write_inodeblock_ufs2(inodedep, bp) panic("initiate_write_inodeblock_ufs2: already started"); inodedep->id_state |= IOSTARTED; fs = inodedep->id_fs; + ump = VFSTOUFS(inodedep->id_list.wk_mp); + LOCK_OWNED(ump); dp = (struct ufs2_dinode *)bp->b_data + ino_to_fsbo(fs, inodedep->id_ino); @@ -10085,10 +10206,10 @@ initiate_write_inodeblock_ufs2(inodedep, bp) if ((inodedep->id_state & DEPCOMPLETE) == 0) { if (inodedep->id_savedino2 != NULL) panic("initiate_write_inodeblock_ufs2: I/O underway"); - FREE_LOCK(&lk); + FREE_LOCK(ump); sip = malloc(sizeof(struct ufs2_dinode), M_SAVEDINO, M_SOFTDEP_FLAGS); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); inodedep->id_savedino2 = sip; *inodedep->id_savedino2 = *dp; bzero((caddr_t)dp, sizeof(struct ufs2_dinode)); @@ -10299,7 +10420,7 @@ cancel_indirdep(indirdep, bp, freeblks) LIST_REMOVE(indirdep, ir_next); } indirdep->ir_state |= GOINGAWAY; - VFSTOUFS(indirdep->ir_list.wk_mp)->um_numindirdeps += 1; + VFSTOUFS(indirdep->ir_list.wk_mp)->softdep_numindirdeps += 1; /* * Pass in bp for blocks still have journal writes * pending so we can cancel them on their own. @@ -10365,6 +10486,7 @@ initiate_write_indirdep(indirdep, bp) struct indirdep *indirdep; struct buf *bp; { + struct ufsmount *ump; indirdep->ir_state |= IOSTARTED; if (indirdep->ir_state & GOINGAWAY) @@ -10380,10 +10502,12 @@ initiate_write_indirdep(indirdep, bp) * Replace up-to-date version with safe version. */ if (indirdep->ir_saveddata == NULL) { - FREE_LOCK(&lk); + ump = VFSTOUFS(indirdep->ir_list.wk_mp); + LOCK_OWNED(ump); + FREE_LOCK(ump); indirdep->ir_saveddata = malloc(bp->b_bcount, M_INDIRDEP, M_SOFTDEP_FLAGS); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } indirdep->ir_state &= ~ATTACHED; indirdep->ir_state |= UNDONE; @@ -10405,12 +10529,16 @@ softdep_setup_inofree(mp, bp, ino, wkhd) { struct worklist *wk, *wkn; struct inodedep *inodedep; + struct ufsmount *ump; uint8_t *inosused; struct cg *cgp; struct fs *fs; - ACQUIRE_LOCK(&lk); - fs = VFSTOUFS(mp)->um_fs; + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_setup_inofree called on non-softdep filesystem")); + ump = VFSTOUFS(mp); + ACQUIRE_LOCK(ump); + fs = ump->um_fs; cgp = (struct cg *)bp->b_data; inosused = cg_inosused(cgp); if (isset(inosused, ino % fs->fs_ipg)) @@ -10434,7 +10562,7 @@ softdep_setup_inofree(mp, bp, ino, wkhd) } jwork_move(&bp->b_dep, wkhd); } - FREE_LOCK(&lk); + FREE_LOCK(ump); } @@ -10454,6 +10582,7 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) { struct bmsafemap *bmsafemap; struct jnewblk *jnewblk; + struct ufsmount *ump; struct worklist *wk; struct fs *fs; #ifdef SUJ_DEBUG @@ -10470,9 +10599,12 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) "softdep_setup_blkfree: blkno %jd frags %d wk head %p", blkno, frags, wkhd); - ACQUIRE_LOCK(&lk); + ump = VFSTOUFS(mp); + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ump)) != 0, + ("softdep_setup_blkfree called on non-softdep filesystem")); + ACQUIRE_LOCK(ump); /* Lookup the bmsafemap so we track when it is dirty. */ - fs = VFSTOUFS(mp)->um_fs; + fs = ump->um_fs; bmsafemap = bmsafemap_lookup(mp, bp, dtog(fs, blkno), NULL); /* * Detach any jnewblks which have been canceled. They must linger @@ -10546,7 +10678,7 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) } } #endif - FREE_LOCK(&lk); + FREE_LOCK(ump); } /* @@ -10553,7 +10685,7 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) * Revert a block allocation when the journal record that describes it * is not yet written. */ -int +static int jnewblk_rollback(jnewblk, fs, cgp, blksfree) struct jnewblk *jnewblk; struct fs *fs; @@ -10692,6 +10824,7 @@ softdep_disk_write_complete(bp) { struct worklist *wk; struct worklist *owk; + struct ufsmount *ump; struct workhead reattach; struct freeblks *freeblks; struct buf *sbp; @@ -10702,6 +10835,9 @@ softdep_disk_write_complete(bp) */ if ((bp->b_ioflags & BIO_ERROR) != 0 && (bp->b_flags & B_INVAL) == 0) return; + if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) + return; + ump = VFSTOUFS(wk->wk_mp); LIST_INIT(&reattach); /* * This lock must not be released anywhere in this code segment. @@ -10708,10 +10844,10 @@ softdep_disk_write_complete(bp) */ sbp = NULL; owk = NULL; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) { WORKLIST_REMOVE(wk); - dep_write[wk->wk_type]++; + atomic_add_long(&dep_write[wk->wk_type], 1); if (wk == owk) panic("duplicate worklist: %p\n", wk); owk = wk; @@ -10793,7 +10929,7 @@ softdep_disk_write_complete(bp) WORKLIST_REMOVE(wk); WORKLIST_INSERT(&bp->b_dep, wk); } - FREE_LOCK(&lk); + FREE_LOCK(ump); if (sbp) brelse(sbp); } @@ -11393,8 +11529,8 @@ diradd_inode_written(dap, inodedep) } /* - * Returns true if the bmsafemap will have rollbacks when written. Must - * only be called with lk and the buf lock on the cg held. + * Returns true if the bmsafemap will have rollbacks when written. Must only + * be called with the per-filesystem lock and the buf lock on the cg held. */ static int bmsafemap_backgroundwrite(bmsafemap, bp) @@ -11403,6 +11539,7 @@ bmsafemap_backgroundwrite(bmsafemap, bp) { int dirty; + LOCK_OWNED(VFSTOUFS(bmsafemap->sm_list.wk_mp)); dirty = !LIST_EMPTY(&bmsafemap->sm_jaddrefhd) | !LIST_EMPTY(&bmsafemap->sm_jnewblkhd); /* @@ -11759,18 +11896,20 @@ softdep_load_inodeblock(ip) { struct inodedep *inodedep; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_load_inodeblock called on non-softdep filesystem")); /* * Check for alternate nlink count. */ ip->i_effnlink = ip->i_nlink; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); if (inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0, &inodedep) == 0) { - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); return; } ip->i_effnlink -= inodedep->id_nlinkdelta; - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); } /* @@ -11791,6 +11930,7 @@ softdep_update_inodeblock(ip, bp, waitfor) { struct inodedep *inodedep; struct inoref *inoref; + struct ufsmount *ump; struct worklist *wk; struct mount *mp; struct buf *ibp; @@ -11797,7 +11937,10 @@ softdep_update_inodeblock(ip, bp, waitfor) struct fs *fs; int error; - mp = UFSTOVFS(ip->i_ump); + ump = ip->i_ump; + mp = UFSTOVFS(ump); + KASSERT(MOUNTEDSOFTDEP(mp) != 0, + ("softdep_update_inodeblock called on non-softdep filesystem")); fs = ip->i_fs; /* * Preserve the freelink that is on disk. clear_unlinked_inodedep() @@ -11817,10 +11960,10 @@ softdep_update_inodeblock(ip, bp, waitfor) * if there is no existing inodedep, then there are no dependencies * to track. */ - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); again: if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) == 0) { - FREE_LOCK(&lk); + FREE_LOCK(ump); if (ip->i_effnlink != ip->i_nlink) panic("softdep_update_inodeblock: bad link count"); return; @@ -11879,16 +12022,16 @@ again: * to be written so that the update can be done. */ if (waitfor == 0) { - FREE_LOCK(&lk); + FREE_LOCK(ump); return; } retry: if ((inodedep->id_state & (DEPCOMPLETE | GOINGAWAY)) != 0) { - FREE_LOCK(&lk); + FREE_LOCK(ump); return; } ibp = inodedep->id_bmsafemap->sm_buf; - ibp = getdirtybuf(ibp, &lk, MNT_WAIT); + ibp = getdirtybuf(ibp, LOCK_PTR(ump), MNT_WAIT); if (ibp == NULL) { /* * If ibp came back as NULL, the dependency could have been @@ -11897,10 +12040,10 @@ retry: */ if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) != 0) goto retry; - FREE_LOCK(&lk); + FREE_LOCK(ump); return; } - FREE_LOCK(&lk); + FREE_LOCK(ump); if ((error = bwrite(ibp)) != 0) softdep_error("softdep_update_inodeblock: bwrite", error); } @@ -11949,6 +12092,7 @@ softdep_fsync(vp) struct inodedep *inodedep; struct pagedep *pagedep; struct inoref *inoref; + struct ufsmount *ump; struct worklist *wk; struct diradd *dap; struct mount *mp; @@ -11963,11 +12107,14 @@ softdep_fsync(vp) ip = VTOI(vp); fs = ip->i_fs; + ump = ip->i_ump; mp = vp->v_mount; - ACQUIRE_LOCK(&lk); + if (MOUNTEDSOFTDEP(mp) == 0) + return (0); + ACQUIRE_LOCK(ump); restart: if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) == 0) { - FREE_LOCK(&lk); + FREE_LOCK(ump); return (0); } TAILQ_FOREACH(inoref, &inodedep->id_inoreflst, if_deps) { @@ -12025,7 +12172,7 @@ restart: * the lock on our parent. See the comment in ufs_lookup * for details on possible races. */ - FREE_LOCK(&lk); + FREE_LOCK(ump); if (ffs_vgetf(mp, parentino, LK_NOWAIT | LK_EXCLUSIVE, &pvp, FFSV_FORCEINSMQ)) { error = vfs_busy(mp, MBF_NOWAIT); @@ -12070,7 +12217,7 @@ restart: vput(pvp); return (error); } - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); locked = 1; if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) != 0) { if ((wk = LIST_FIRST(&inodedep->id_pendinghd)) != NULL) { @@ -12083,7 +12230,7 @@ restart: else pagedep = dap->da_pagedep; pagedep_new_block = pagedep->pd_state & NEWBLOCK; - FREE_LOCK(&lk); + FREE_LOCK(ump); locked = 0; if (pagedep_new_block && (error = ffs_syncvnode(pvp, MNT_WAIT, 0))) { @@ -12093,7 +12240,7 @@ restart: } } if (locked) - FREE_LOCK(&lk); + FREE_LOCK(ump); } /* * Flush directory page containing the inode's name. @@ -12107,11 +12254,11 @@ restart: vput(pvp); if (error != 0) return (error); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) == 0) break; } - FREE_LOCK(&lk); + FREE_LOCK(ump); return (0); } @@ -12135,7 +12282,6 @@ softdep_fsync_mountdev(vp) bo = &vp->v_bufobj; restart: BO_LOCK(bo); - ACQUIRE_LOCK(&lk); TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) { /* * If it is already scheduled, skip to the next buffer. @@ -12155,13 +12301,11 @@ restart: BUF_UNLOCK(bp); continue; } - FREE_LOCK(&lk); BO_UNLOCK(bo); bremfree(bp); (void) bawrite(bp); goto restart; } - FREE_LOCK(&lk); drain_output(vp); BO_UNLOCK(bo); } @@ -12187,7 +12331,7 @@ sync_cgs(mp, waitfor) sentinel->sm_cg = -1; ump = VFSTOUFS(mp); error = 0; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); LIST_INSERT_HEAD(&ump->softdep_dirtycg, sentinel, sm_next); for (bmsafemap = LIST_NEXT(sentinel, sm_next); bmsafemap != NULL; bmsafemap = LIST_NEXT(sentinel, sm_next)) { @@ -12203,7 +12347,7 @@ sync_cgs(mp, waitfor) * If we don't get the lock and we're waiting try again, if * not move on to the next buf and try to sync it. */ - bp = getdirtybuf(bmsafemap->sm_buf, &lk, waitfor); + bp = getdirtybuf(bmsafemap->sm_buf, LOCK_PTR(ump), waitfor); if (bp == NULL && waitfor == MNT_WAIT) continue; LIST_REMOVE(sentinel, sm_next); @@ -12210,17 +12354,17 @@ sync_cgs(mp, waitfor) LIST_INSERT_AFTER(bmsafemap, sentinel, sm_next); if (bp == NULL) continue; - FREE_LOCK(&lk); + FREE_LOCK(ump); if (waitfor == MNT_NOWAIT) bawrite(bp); else error = bwrite(bp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (error) break; } LIST_REMOVE(sentinel, sm_next); - FREE_LOCK(&lk); + FREE_LOCK(ump); free(sentinel, M_BMSAFEMAP); return (error); } @@ -12233,25 +12377,29 @@ sync_cgs(mp, waitfor) int softdep_sync_metadata(struct vnode *vp) { + struct inode *ip; int error; + ip = VTOI(vp); + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_sync_metadata called on non-softdep filesystem")); /* * Ensure that any direct block dependencies have been cleared, * truncations are started, and inode references are journaled. */ - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ip->i_ump); /* * Write all journal records to prevent rollbacks on devvp. */ if (vp->v_type == VCHR) softdep_flushjournal(vp->v_mount); - error = flush_inodedep_deps(vp, vp->v_mount, VTOI(vp)->i_number); + error = flush_inodedep_deps(vp, vp->v_mount, ip->i_number); /* * Ensure that all truncates are written so we won't find deps on * indirect blocks. */ process_truncates(vp); - FREE_LOCK(&lk); + FREE_LOCK(ip->i_ump); return (error); } @@ -12270,10 +12418,13 @@ softdep_sync_buf(struct vnode *vp, struct buf *bp, struct pagedep *pagedep; struct allocindir *aip; struct newblk *newblk; + struct ufsmount *ump; struct buf *nbp; struct worklist *wk; int i, error; + KASSERT(MOUNTEDSOFTDEP(vp->v_mount) != 0, + ("softdep_sync_buf called on non-softdep filesystem")); /* * For VCHR we just don't want to force flush any dependencies that * will cause rollbacks. @@ -12283,7 +12434,8 @@ softdep_sync_buf(struct vnode *vp, struct buf *bp, return (EBUSY); return (0); } - ACQUIRE_LOCK(&lk); + ump = VTOI(vp)->i_ump; + ACQUIRE_LOCK(ump); /* * As we hold the buffer locked, none of its dependencies * will disappear. @@ -12308,13 +12460,13 @@ top: waitfor == MNT_NOWAIT) continue; nbp = newblk->nb_bmsafemap->sm_buf; - nbp = getdirtybuf(nbp, &lk, waitfor); + nbp = getdirtybuf(nbp, LOCK_PTR(ump), waitfor); if (nbp == NULL) goto top; - FREE_LOCK(&lk); + FREE_LOCK(ump); if ((error = bwrite(nbp)) != 0) goto out; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); continue; case D_INDIRDEP: @@ -12339,13 +12491,13 @@ top: if (newblk->nb_state & DEPCOMPLETE) continue; nbp = newblk->nb_bmsafemap->sm_buf; - nbp = getdirtybuf(nbp, &lk, waitfor); + nbp = getdirtybuf(nbp, LOCK_PTR(ump), waitfor); if (nbp == NULL) goto restart; - FREE_LOCK(&lk); + FREE_LOCK(ump); if ((error = bwrite(nbp)) != 0) goto out; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); goto restart; } continue; @@ -12396,7 +12548,7 @@ top: } } out_unlock: - FREE_LOCK(&lk); + FREE_LOCK(ump); out: return (error); } @@ -12413,6 +12565,7 @@ flush_inodedep_deps(vp, mp, ino) { struct inodedep *inodedep; struct inoref *inoref; + struct ufsmount *ump; int error, waitfor; /* @@ -12428,11 +12581,13 @@ flush_inodedep_deps(vp, mp, ino) * We give a brief window at the top of the loop to allow * any pending I/O to complete. */ + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); for (error = 0, waitfor = MNT_NOWAIT; ; ) { if (error) return (error); - FREE_LOCK(&lk); - ACQUIRE_LOCK(&lk); + FREE_LOCK(ump); + ACQUIRE_LOCK(ump); restart: if (inodedep_lookup(mp, ino, 0, &inodedep) == 0) return (0); @@ -12475,9 +12630,13 @@ flush_deplist(listhead, waitfor, errorp) { struct allocdirect *adp; struct newblk *newblk; + struct ufsmount *ump; struct buf *bp; - rw_assert(&lk, RA_WLOCKED); + if ((adp = TAILQ_FIRST(listhead)) == NULL) + return (0); + ump = VFSTOUFS(adp->ad_list.wk_mp); + LOCK_OWNED(ump); TAILQ_FOREACH(adp, listhead, ad_next) { newblk = (struct newblk *)adp; if (newblk->nb_jnewblk != NULL) { @@ -12487,18 +12646,18 @@ flush_deplist(listhead, waitfor, errorp) if (newblk->nb_state & DEPCOMPLETE) continue; bp = newblk->nb_bmsafemap->sm_buf; - bp = getdirtybuf(bp, &lk, waitfor); + bp = getdirtybuf(bp, LOCK_PTR(ump), waitfor); if (bp == NULL) { if (waitfor == MNT_NOWAIT) continue; return (1); } - FREE_LOCK(&lk); + FREE_LOCK(ump); if (waitfor == MNT_NOWAIT) bawrite(bp); else *errorp = bwrite(bp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); return (1); } return (0); @@ -12514,6 +12673,7 @@ flush_newblk_dep(vp, mp, lbn) ufs_lbn_t lbn; { struct newblk *newblk; + struct ufsmount *ump; struct bufobj *bo; struct inode *ip; struct buf *bp; @@ -12526,7 +12686,8 @@ flush_newblk_dep(vp, mp, lbn) blkno = DIP(ip, i_db[lbn]); if (blkno == 0) panic("flush_newblk_dep: Missing block"); - ACQUIRE_LOCK(&lk); + ump = VFSTOUFS(mp); + ACQUIRE_LOCK(ump); /* * Loop until all dependencies related to this block are satisfied. * We must be careful to restart after each sleep in case a write @@ -12534,7 +12695,7 @@ flush_newblk_dep(vp, mp, lbn) */ for (;;) { if (newblk_lookup(mp, blkno, 0, &newblk) == 0) { - FREE_LOCK(&lk); + FREE_LOCK(ump); break; } if (newblk->nb_list.wk_type != D_ALLOCDIRECT) @@ -12551,20 +12712,20 @@ flush_newblk_dep(vp, mp, lbn) */ if ((newblk->nb_state & DEPCOMPLETE) == 0) { bp = newblk->nb_bmsafemap->sm_buf; - bp = getdirtybuf(bp, &lk, MNT_WAIT); + bp = getdirtybuf(bp, LOCK_PTR(ump), MNT_WAIT); if (bp == NULL) continue; - FREE_LOCK(&lk); + FREE_LOCK(ump); error = bwrite(bp); if (error) break; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); continue; } /* * Write the buffer. */ - FREE_LOCK(&lk); + FREE_LOCK(ump); BO_LOCK(bo); bp = gbincore(bo, lbn); if (bp != NULL) { @@ -12571,7 +12732,7 @@ flush_newblk_dep(vp, mp, lbn) error = BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo)); if (error == ENOLCK) { - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); continue; /* Slept, retry */ } if (error != 0) @@ -12593,7 +12754,7 @@ flush_newblk_dep(vp, mp, lbn) error = ffs_update(vp, 1); if (error) break; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } return (error); } @@ -12618,6 +12779,7 @@ flush_pagedep_deps(pvp, mp, diraddhdp) ino_t inum; ump = VFSTOUFS(mp); + LOCK_OWNED(ump); restart: while ((dap = LIST_FIRST(diraddhdp)) != NULL) { /* @@ -12625,10 +12787,10 @@ restart: * has a MKDIR_PARENT dependency. */ if (dap->da_state & MKDIR_PARENT) { - FREE_LOCK(&lk); + FREE_LOCK(ump); if ((error = ffs_update(pvp, 1)) != 0) break; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); /* * If that cleared dependencies, go on to next. */ @@ -12657,7 +12819,7 @@ restart: } } if (dap->da_state & MKDIR_BODY) { - FREE_LOCK(&lk); + FREE_LOCK(ump); if ((error = ffs_vgetf(mp, inum, LK_EXCLUSIVE, &vp, FFSV_FORCEINSMQ))) break; @@ -12672,7 +12834,7 @@ restart: vput(vp); if (error != 0) break; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); /* * If that cleared dependencies, go on to next. */ @@ -12705,13 +12867,13 @@ retry: */ if ((inodedep->id_state & (DEPCOMPLETE | GOINGAWAY)) == 0) { bp = inodedep->id_bmsafemap->sm_buf; - bp = getdirtybuf(bp, &lk, MNT_WAIT); + bp = getdirtybuf(bp, LOCK_PTR(ump), MNT_WAIT); if (bp == NULL) goto retry; - FREE_LOCK(&lk); + FREE_LOCK(ump); if ((error = bwrite(bp)) != 0) break; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (dap != LIST_FIRST(diraddhdp)) continue; } @@ -12721,7 +12883,7 @@ retry: * adjusted update it here to flush it to disk. */ if (dap == LIST_FIRST(diraddhdp)) { - FREE_LOCK(&lk); + FREE_LOCK(ump); if ((error = ffs_vgetf(mp, inum, LK_EXCLUSIVE, &vp, FFSV_FORCEINSMQ))) break; @@ -12729,7 +12891,7 @@ retry: vput(vp); if (error) break; - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } /* * If we have failed to get rid of all the dependencies @@ -12743,7 +12905,7 @@ retry: } } if (error) - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); return (error); } @@ -12762,13 +12924,15 @@ softdep_slowdown(vp) int jlow; int max_softdeps_hard; - ACQUIRE_LOCK(&lk); + KASSERT(MOUNTEDSOFTDEP(vp->v_mount) != 0, + ("softdep_slowdown called on non-softdep filesystem")); + ump = VFSTOUFS(vp->v_mount); + ACQUIRE_LOCK(ump); jlow = 0; /* * Check for journal space if needed. */ if (DOINGSUJ(vp)) { - ump = VFSTOUFS(vp->v_mount); if (journal_space(ump, 0) == 0) jlow = 1; } @@ -12775,15 +12939,15 @@ softdep_slowdown(vp) max_softdeps_hard = max_softdeps * 11 / 10; if (dep_current[D_DIRREM] < max_softdeps_hard / 2 && dep_current[D_INODEDEP] < max_softdeps_hard && - VFSTOUFS(vp->v_mount)->um_numindirdeps < maxindirdeps && + VFSTOUFS(vp->v_mount)->softdep_numindirdeps < maxindirdeps && dep_current[D_FREEBLKS] < max_softdeps_hard && jlow == 0) { - FREE_LOCK(&lk); + FREE_LOCK(ump); return (0); } - if (VFSTOUFS(vp->v_mount)->um_numindirdeps >= maxindirdeps || jlow) + if (VFSTOUFS(vp->v_mount)->softdep_numindirdeps >= maxindirdeps || jlow) softdep_speedup(); stat_sync_limit_hit += 1; - FREE_LOCK(&lk); + FREE_LOCK(ump); if (DOINGSUJ(vp)) return (0); return (1); @@ -12836,7 +13000,7 @@ softdep_request_cleanup(fs, vp, cred, resource) mtx_assert(UFS_MTX(ump), MA_OWNED); UFS_UNLOCK(ump); error = ffs_update(vp, 1); - if (error != 0) { + if (error != 0 || MOUNTEDSOFTDEP(mp) == 0) { UFS_LOCK(ump); return (0); } @@ -12844,11 +13008,11 @@ softdep_request_cleanup(fs, vp, cred, resource) * If we are in need of resources, consider pausing for * tickdelay to give ourselves some breathing room. */ - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); process_removes(vp); process_truncates(vp); request_cleanup(UFSTOVFS(ump), resource); - FREE_LOCK(&lk); + FREE_LOCK(ump); /* * Now clean up at least as many resources as we will need. * @@ -12891,12 +13055,12 @@ retry: fs->fs_cstotal.cs_nbfree <= needed) || (resource == FLUSH_INODES_WAIT && fs->fs_pendinginodes > 0 && fs->fs_cstotal.cs_nifree <= needed)) { - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); if (ump->softdep_on_worklist > 0 && process_worklist_item(UFSTOVFS(ump), ump->softdep_on_worklist, LK_NOWAIT) != 0) stat_worklist_push += 1; - FREE_LOCK(&lk); + FREE_LOCK(ump); } /* * If we still need resources and there are no more worklist @@ -12946,7 +13110,6 @@ retry: * If memory utilization has gotten too high, deliberately slow things * down and speed up the I/O processing. */ -extern struct thread *syncertd; static int request_cleanup(mp, resource) struct mount *mp; @@ -12955,13 +13118,13 @@ request_cleanup(mp, resource) struct thread *td = curthread; struct ufsmount *ump; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); /* * We never hold up the filesystem syncer or buf daemon. */ if (td->td_pflags & (TDP_SOFTDEP|TDP_NORUNNINGBUF)) return (0); - ump = VFSTOUFS(mp); /* * First check to see if the work list has gotten backlogged. * If it has, co-opt this process to help clean up two entries. @@ -12999,15 +13162,19 @@ request_cleanup(mp, resource) case FLUSH_INODES: case FLUSH_INODES_WAIT: + ACQUIRE_GBLLOCK(&lk); stat_ino_limit_push += 1; req_clear_inodedeps += 1; + FREE_GBLLOCK(&lk); stat_countp = &stat_ino_limit_hit; break; case FLUSH_BLOCKS: case FLUSH_BLOCKS_WAIT: + ACQUIRE_GBLLOCK(&lk); stat_blk_limit_push += 1; req_clear_remove += 1; + FREE_GBLLOCK(&lk); stat_countp = &stat_blk_limit_hit; break; @@ -13018,6 +13185,8 @@ request_cleanup(mp, resource) * Hopefully the syncer daemon will catch up and awaken us. * We wait at most tickdelay before proceeding in any case. */ + ACQUIRE_GBLLOCK(&lk); + FREE_LOCK(ump); proc_waiting += 1; if (callout_pending(&softdep_callout) == FALSE) callout_reset(&softdep_callout, tickdelay > 2 ? tickdelay : 2, @@ -13025,12 +13194,15 @@ request_cleanup(mp, resource) msleep((caddr_t)&proc_waiting, &lk, PPAUSE, "softupdate", 0); proc_waiting -= 1; + FREE_GBLLOCK(&lk); + ACQUIRE_LOCK(ump); return (1); } /* * Awaken processes pausing in request_cleanup and clear proc_waiting - * to indicate that there is no longer a timer running. + * to indicate that there is no longer a timer running. Pause_timer + * will be called with the global softdep mutex (&lk) locked. */ static void pause_timer(arg) @@ -13037,6 +13209,7 @@ pause_timer(arg) void *arg; { + GBLLOCK_OWNED(&lk); /* * The callout_ API has acquired mtx and will hold it around this * function call. @@ -13053,31 +13226,31 @@ pause_timer(arg) * reduce the number of dirrem, freefile, and freeblks dependency structures. */ static void -clear_remove(void) +clear_remove(mp) + struct mount *mp; { struct pagedep_hashhead *pagedephd; struct pagedep *pagedep; - static int next = 0; - struct mount *mp; + struct ufsmount *ump; struct vnode *vp; struct bufobj *bo; int error, cnt; ino_t ino; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(mp); + LOCK_OWNED(ump); - for (cnt = 0; cnt <= pagedep_hash; cnt++) { - pagedephd = &pagedep_hashtbl[next++]; - if (next > pagedep_hash) - next = 0; + for (cnt = 0; cnt <= ump->pagedep_hash_size; cnt++) { + pagedephd = &ump->pagedep_hashtbl[ump->pagedep_nextclean++]; + if (ump->pagedep_nextclean > ump->pagedep_hash_size) + ump->pagedep_nextclean = 0; LIST_FOREACH(pagedep, pagedephd, pd_hash) { if (LIST_EMPTY(&pagedep->pd_dirremhd)) continue; - mp = pagedep->pd_list.wk_mp; ino = pagedep->pd_ino; if (vn_start_write(NULL, &mp, V_NOWAIT) != 0) continue; - FREE_LOCK(&lk); + FREE_LOCK(ump); /* * Let unmount clear deps @@ -13101,7 +13274,7 @@ static void vput(vp); finish_write: vn_finished_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); return; } } @@ -13112,34 +13285,34 @@ static void * the number of inodedep dependency structures. */ static void -clear_inodedeps(void) +clear_inodedeps(mp) + struct mount *mp; { struct inodedep_hashhead *inodedephd; struct inodedep *inodedep; - static int next = 0; - struct mount *mp; + struct ufsmount *ump; struct vnode *vp; struct fs *fs; int error, cnt; ino_t firstino, lastino, ino; - rw_assert(&lk, RA_WLOCKED); + ump = VFSTOUFS(mp); + fs = ump->um_fs; + LOCK_OWNED(ump); /* * Pick a random inode dependency to be cleared. * We will then gather up all the inodes in its block * that have dependencies and flush them out. */ - for (cnt = 0; cnt <= inodedep_hash; cnt++) { - inodedephd = &inodedep_hashtbl[next++]; - if (next > inodedep_hash) - next = 0; + for (cnt = 0; cnt <= ump->inodedep_hash_size; cnt++) { + inodedephd = &ump->inodedep_hashtbl[ump->inodedep_nextclean++]; + if (ump->inodedep_nextclean > ump->inodedep_hash_size) + ump->inodedep_nextclean = 0; if ((inodedep = LIST_FIRST(inodedephd)) != NULL) break; } if (inodedep == NULL) return; - fs = inodedep->id_fs; - mp = inodedep->id_list.wk_mp; /* * Find the last inode in the block with dependencies. */ @@ -13157,11 +13330,11 @@ static void continue; if (vn_start_write(NULL, &mp, V_NOWAIT) != 0) continue; - FREE_LOCK(&lk); + FREE_LOCK(ump); error = vfs_busy(mp, MBF_NOWAIT); /* Let unmount clear deps */ if (error != 0) { vn_finished_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); return; } if ((error = ffs_vgetf(mp, ino, LK_EXCLUSIVE, &vp, @@ -13169,7 +13342,7 @@ static void softdep_error("clear_inodedeps: vget", error); vfs_unbusy(mp); vn_finished_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); return; } vfs_unbusy(mp); @@ -13185,7 +13358,7 @@ static void } vput(vp); vn_finished_write(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); } } @@ -13195,13 +13368,19 @@ softdep_buf_append(bp, wkhd) struct workhead *wkhd; { struct worklist *wk; + struct ufsmount *ump; - ACQUIRE_LOCK(&lk); + if ((wk = LIST_FIRST(wkhd)) == NULL) + return; + KASSERT(MOUNTEDSOFTDEP(wk->wk_mp) != 0, + ("softdep_buf_append called on non-softdep filesystem")); + ump = VFSTOUFS(wk->wk_mp); + ACQUIRE_LOCK(ump); while ((wk = LIST_FIRST(wkhd)) != NULL) { WORKLIST_REMOVE(wk); WORKLIST_INSERT(&bp->b_dep, wk); } - FREE_LOCK(&lk); + FREE_LOCK(ump); } @@ -13215,6 +13394,8 @@ softdep_inode_append(ip, cred, wkhd) struct fs *fs; int error; + KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, + ("softdep_inode_append called on non-softdep filesystem")); fs = ip->i_fs; error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), (int)fs->fs_bsize, cred, &bp); @@ -13231,10 +13412,17 @@ void softdep_freework(wkhd) struct workhead *wkhd; { + struct worklist *wk; + struct ufsmount *ump; - ACQUIRE_LOCK(&lk); + if ((wk = LIST_FIRST(wkhd)) == NULL) + return; + KASSERT(MOUNTEDSOFTDEP(wk->wk_mp) != 0, + ("softdep_freework called on non-softdep filesystem")); + ump = VFSTOUFS(wk->wk_mp); + ACQUIRE_LOCK(ump); handle_jwork(wkhd); - FREE_LOCK(&lk); + FREE_LOCK(ump); } /* @@ -13248,6 +13436,7 @@ softdep_count_dependencies(bp, wantcount) int wantcount; { struct worklist *wk; + struct ufsmount *ump; struct bmsafemap *bmsafemap; struct freework *freework; struct inodedep *inodedep; @@ -13262,7 +13451,10 @@ softdep_count_dependencies(bp, wantcount) int i, retval; retval = 0; - ACQUIRE_LOCK(&lk); + if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) + return (0); + ump = VFSTOUFS(wk->wk_mp); + ACQUIRE_LOCK(ump); LIST_FOREACH(wk, &bp->b_dep, wk_list) { switch (wk->wk_type) { @@ -13395,7 +13587,7 @@ softdep_count_dependencies(bp, wantcount) } } out: - FREE_LOCK(&lk); + FREE_LOCK(ump); return retval; } @@ -13412,7 +13604,6 @@ getdirtybuf(bp, lock, waitfor) { int error; - rw_assert(lock, RA_WLOCKED); if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) { if (waitfor != MNT_WAIT) return (NULL); @@ -13430,7 +13621,7 @@ getdirtybuf(bp, lock, waitfor) return (NULL); } if ((bp->b_vflags & BV_BKGRDINPROG) != 0) { - if (lock == &lk && waitfor == MNT_WAIT) { + if (lock != BO_LOCKPTR(bp->b_bufobj) && waitfor == MNT_WAIT) { rw_wunlock(lock); BO_LOCK(bp->b_bufobj); BUF_UNLOCK(bp); @@ -13476,8 +13667,8 @@ getdirtybuf(bp, lock, waitfor) int softdep_check_suspend(struct mount *mp, struct vnode *devvp, - int softdep_deps, - int softdep_accdeps, + int softdep_depcnt, + int softdep_accdepcnt, int secondary_writes, int secondary_accwrites) { @@ -13485,21 +13676,55 @@ softdep_check_suspend(struct mount *mp, struct ufsmount *ump; int error; - ump = VFSTOUFS(mp); bo = &devvp->v_bufobj; ASSERT_BO_WLOCKED(bo); + /* + * If we are not running with soft updates, then we need only + * deal with secondary writes as we try to suspend. + */ + if (MOUNTEDSOFTDEP(mp) == 0) { + MNT_ILOCK(mp); + while (mp->mnt_secondary_writes != 0) { + BO_UNLOCK(bo); + msleep(&mp->mnt_secondary_writes, MNT_MTX(mp), + (PUSER - 1) | PDROP, "secwr", 0); + BO_LOCK(bo); + MNT_ILOCK(mp); + } + + /* + * Reasons for needing more work before suspend: + * - Dirty buffers on devvp. + * - Secondary writes occurred after start of vnode sync loop + */ + error = 0; + if (bo->bo_numoutput > 0 || + bo->bo_dirty.bv_cnt > 0 || + secondary_writes != 0 || + mp->mnt_secondary_writes != 0 || + secondary_accwrites != mp->mnt_secondary_accwrites) + error = EAGAIN; + BO_UNLOCK(bo); + return (error); + } + + /* + * If we are running with soft updates, then we need to coordinate + * with them as we try to suspend. + */ + ump = VFSTOUFS(mp); for (;;) { - if (!TRY_ACQUIRE_LOCK(&lk)) { + if (!TRY_ACQUIRE_LOCK(ump)) { BO_UNLOCK(bo); - ACQUIRE_LOCK(&lk); - FREE_LOCK(&lk); + ACQUIRE_LOCK(ump); + FREE_LOCK(ump); BO_LOCK(bo); continue; } MNT_ILOCK(mp); if (mp->mnt_secondary_writes != 0) { - FREE_LOCK(&lk); + FREE_LOCK(ump); BO_UNLOCK(bo); msleep(&mp->mnt_secondary_writes, MNT_MTX(mp), @@ -13519,14 +13744,14 @@ softdep_check_suspend(struct mount *mp, error = 0; if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0 || - softdep_deps != 0 || + softdep_depcnt != 0 || ump->softdep_deps != 0 || - softdep_accdeps != ump->softdep_accdeps || + softdep_accdepcnt != ump->softdep_accdeps || secondary_writes != 0 || mp->mnt_secondary_writes != 0 || secondary_accwrites != mp->mnt_secondary_accwrites) error = EAGAIN; - FREE_LOCK(&lk); + FREE_LOCK(ump); BO_UNLOCK(bo); return (error); } @@ -13544,11 +13769,16 @@ softdep_get_depcounts(struct mount *mp, { struct ufsmount *ump; + if (MOUNTEDSOFTDEP(mp) == 0) { + *softdep_depsp = 0; + *softdep_accdepsp = 0; + return; + } ump = VFSTOUFS(mp); - ACQUIRE_LOCK(&lk); + ACQUIRE_LOCK(ump); *softdep_depsp = ump->softdep_deps; *softdep_accdepsp = ump->softdep_accdeps; - FREE_LOCK(&lk); + FREE_LOCK(ump); } /* @@ -13653,15 +13883,17 @@ DB_SHOW_COMMAND(inodedeps, db_show_inodedeps) { struct inodedep_hashhead *inodedephd; struct inodedep *inodedep; - struct fs *fs; + struct ufsmount *ump; int cnt; - fs = have_addr ? (struct fs *)addr : NULL; - for (cnt = 0; cnt < inodedep_hash; cnt++) { - inodedephd = &inodedep_hashtbl[cnt]; + if (have_addr == 0) { + db_printf("Address required\n"); + return; + } + ump = (struct ufsmount *)addr; + for (cnt = 0; cnt < ump->inodedep_hash_size; cnt++) { + inodedephd = &ump->inodedep_hashtbl[cnt]; LIST_FOREACH(inodedep, inodedephd, id_hash) { - if (fs != NULL && fs != inodedep->id_fs) - continue; inodedep_print(inodedep, 0); } } @@ -13703,11 +13935,17 @@ DB_SHOW_COMMAND(workhead, db_show_workhead) DB_SHOW_COMMAND(mkdirs, db_show_mkdirs) { + struct mkdirlist *mkdirlisthd; struct jaddref *jaddref; struct diradd *diradd; struct mkdir *mkdir; - LIST_FOREACH(mkdir, &mkdirlisthd, md_mkdirs) { + if (have_addr == 0) { + db_printf("Address required\n"); + return; + } + mkdirlisthd = (struct mkdirlist *)addr; + LIST_FOREACH(mkdir, mkdirlisthd, md_mkdirs) { diradd = mkdir->md_diradd; db_printf("mkdir: %p state 0x%X dap %p state 0x%X", mkdir, mkdir->md_state, diradd, diradd->da_state); @@ -13718,6 +13956,17 @@ DB_SHOW_COMMAND(mkdirs, db_show_mkdirs) } } +/* exported to ffs_vfsops.c */ +extern void db_print_ffs(struct ufsmount *ump); +void +db_print_ffs(struct ufsmount *ump) +{ + db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n", + ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname, + ump->um_devvp, ump->um_fs, ump->softdep_on_worklist, + ump->softdep_deps, ump->softdep_req); +} + #endif /* DDB */ #endif /* SOFTUPDATES */ Index: /usr/src/sys/ufs/ffs/ffs_vfsops.c =================================================================== --- /usr/src/sys/ufs/ffs/ffs_vfsops.c (revision 256095) +++ /usr/src/sys/ufs/ffs/ffs_vfsops.c (working copy) @@ -1286,7 +1286,8 @@ ffs_unmount(mp, mntflags) fs->fs_pendinginodes = 0; } UFS_UNLOCK(ump); - softdep_unmount(mp); + if (MOUNTEDSOFTDEP(mp)) + softdep_unmount(mp); if (fs->fs_ronly == 0 || ump->um_fsckpid > 0) { fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1; error = ffs_sbupdate(ump, MNT_WAIT, 0); @@ -1943,7 +1944,7 @@ ffs_sbupdate(ump, waitfor, suspended) } fs->fs_fmod = 0; fs->fs_time = time_second; - if (fs->fs_flags & FS_DOSOFTDEP) + if (MOUNTEDSOFTDEP(ump->um_mountp)) softdep_setup_sbupdate(ump, (struct fs *)bp->b_data, bp); bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize); ffs_oldfscompat_write((struct fs *)bp->b_data, ump); @@ -2221,14 +2222,8 @@ ffs_own_mount(const struct mount *mp) #ifdef DDB -static void -db_print_ffs(struct ufsmount *ump) -{ - db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n", - ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname, - ump->um_devvp, ump->um_fs, ump->softdep_on_worklist, - ump->softdep_deps, ump->softdep_req); -} +/* defined in ffs_softdep.c */ +extern void db_print_ffs(struct ufsmount *ump); DB_SHOW_COMMAND(ffs, db_show_ffs) { Index: /usr/src/sys/ufs/ffs/softdep.h =================================================================== --- /usr/src/sys/ufs/ffs/softdep.h (revision 256095) +++ /usr/src/sys/ufs/ffs/softdep.h (working copy) @@ -416,7 +416,8 @@ struct newblk { */ struct allocdirect { struct newblk ad_block; /* Common block logic */ -# define ad_state ad_block.nb_list.wk_state /* block pointer state */ +# define ad_list ad_block.nb_list /* block pointer worklist */ +# define ad_state ad_list.wk_state /* block pointer state */ TAILQ_ENTRY(allocdirect) ad_next; /* inodedep's list of allocdirect's */ struct inodedep *ad_inodedep; /* associated inodedep */ ufs2_daddr_t ad_oldblkno; /* old value of block pointer */ @@ -947,3 +948,112 @@ struct sbdep { struct fs *sb_fs; /* Filesystem pointer within buf. */ struct ufsmount *sb_ump; /* Our mount structure */ }; + +/* + * Private journaling structures. + */ +struct jblocks { + struct jseglst jb_segs; /* TAILQ of current segments. */ + struct jseg *jb_writeseg; /* Next write to complete. */ + struct jseg *jb_oldestseg; /* Oldest segment with valid entries. */ + struct jextent *jb_extent; /* Extent array. */ + uint64_t jb_nextseq; /* Next sequence number. */ + uint64_t jb_oldestwrseq; /* Oldest written sequence number. */ + uint8_t jb_needseg; /* Need a forced segment. */ + uint8_t jb_suspended; /* Did journal suspend writes? */ + int jb_avail; /* Available extents. */ + int jb_used; /* Last used extent. */ + int jb_head; /* Allocator head. */ + int jb_off; /* Allocator extent offset. */ + int jb_blocks; /* Total disk blocks covered. */ + int jb_free; /* Total disk blocks free. */ + int jb_min; /* Minimum free space. */ + int jb_low; /* Low on space. */ + int jb_age; /* Insertion time of oldest rec. */ +}; + +struct jextent { + ufs2_daddr_t je_daddr; /* Disk block address. */ + int je_blocks; /* Disk block count. */ +}; + +/* + * Hash table declarations. + */ +LIST_HEAD(mkdirlist, mkdir); +LIST_HEAD(pagedep_hashhead, pagedep); +LIST_HEAD(inodedep_hashhead, inodedep); +LIST_HEAD(newblk_hashhead, newblk); +LIST_HEAD(bmsafemap_hashhead, bmsafemap); +TAILQ_HEAD(indir_hashhead, freework); + +/* + * Per-filesystem soft dependency data. + * Allocated at mount and freed at unmount. + */ +struct mount_softdeps { + struct rwlock sd_fslock; /* softdep lock */ + struct workhead sd_workitem_pending; /* softdep work queue */ + struct worklist *sd_worklist_tail; /* Tail pointer for above */ + struct workhead sd_journal_pending; /* journal work queue */ + struct worklist *sd_journal_tail; /* Tail pointer for above */ + struct jblocks *sd_jblocks; /* Journal block information */ + struct inodedeplst sd_unlinked; /* Unlinked inodes */ + struct bmsafemaphd sd_dirtycg; /* Dirty CGs */ + struct mkdirlist sd_mkdirlisthd; /* Track mkdirs */ + struct pagedep_hashhead *sd_pdhash; /* pagedep hash table */ + u_long sd_pdhashsize; /* pagedep hash table size-1 */ + long sd_pdnextclean; /* next hash bucket to clean */ + struct inodedep_hashhead *sd_idhash; /* inodedep hash table */ + u_long sd_idhashsize; /* inodedep hash table size-1 */ + long sd_idnextclean; /* next hash bucket to clean */ + struct newblk_hashhead *sd_newblkhash; /* newblk hash table */ + u_long sd_newblkhashsize; /* newblk hash table size-1 */ + struct bmsafemap_hashhead *sd_bmhash; /* bmsafemap hash table */ + u_long sd_bmhashsize; /* bmsafemap hash table size-1*/ + struct indir_hashhead *sd_indirhash; /* indir hash table */ + u_long sd_indirhashsize; /* indir hash table size-1 */ + long sd_numindirdeps; /* outstanding indirdeps */ + int sd_on_journal; /* Items on the journal list */ + int sd_on_worklist; /* Items on the worklist */ + int sd_deps; /* Total dependency count */ + int sd_accdeps; /* accumulated dep count */ + int sd_req; /* Wakeup when deps hits 0. */ + int sd_flags; /* comm with flushing thread */ + struct thread *sd_flushtd; /* thread handling flushing */ +}; +/* + * Flags for communicating with the syncer thread. + */ +#define FLUSH_EXIT 0x0001 /* time to exit */ +/* + * Keep the old names from when these were in the ufsmount structure. + */ +#define softdep_workitem_pending um_softdep->sd_workitem_pending +#define softdep_worklist_tail um_softdep->sd_worklist_tail +#define softdep_journal_pending um_softdep->sd_journal_pending +#define softdep_journal_tail um_softdep->sd_journal_tail +#define softdep_jblocks um_softdep->sd_jblocks +#define softdep_unlinked um_softdep->sd_unlinked +#define softdep_dirtycg um_softdep->sd_dirtycg +#define softdep_mkdirlisthd um_softdep->sd_mkdirlisthd +#define pagedep_hashtbl um_softdep->sd_pdhash +#define pagedep_hash_size um_softdep->sd_pdhashsize +#define pagedep_nextclean um_softdep->sd_pdnextclean +#define inodedep_hashtbl um_softdep->sd_idhash +#define inodedep_hash_size um_softdep->sd_idhashsize +#define inodedep_nextclean um_softdep->sd_idnextclean +#define newblk_hashtbl um_softdep->sd_newblkhash +#define newblk_hash_size um_softdep->sd_newblkhashsize +#define bmsafemap_hashtbl um_softdep->sd_bmhash +#define bmsafemap_hash_size um_softdep->sd_bmhashsize +#define indir_hashtbl um_softdep->sd_indirhash +#define indir_hash_size um_softdep->sd_indirhashsize +#define softdep_numindirdeps um_softdep->sd_numindirdeps +#define softdep_on_journal um_softdep->sd_on_journal +#define softdep_on_worklist um_softdep->sd_on_worklist +#define softdep_deps um_softdep->sd_deps +#define softdep_accdeps um_softdep->sd_accdeps +#define softdep_req um_softdep->sd_req +#define softdep_flags um_softdep->sd_flags +#define softdep_flushtd um_softdep->sd_flushtd Index: /usr/src/sys/ufs/ufs/ufs_extern.h =================================================================== --- /usr/src/sys/ufs/ufs/ufs_extern.h (revision 256095) +++ /usr/src/sys/ufs/ufs/ufs_extern.h (working copy) @@ -98,7 +98,6 @@ void softdep_setup_remove(struct buf *,struct inod void softdep_setup_directory_change(struct buf *, struct inode *, struct inode *, ino_t, int); void softdep_change_linkcnt(struct inode *); -void softdep_releasefile(struct inode *); int softdep_slowdown(struct vnode *); void softdep_setup_create(struct inode *, struct inode *); void softdep_setup_dotdot_link(struct inode *, struct inode *); @@ -107,7 +106,6 @@ void softdep_setup_mkdir(struct inode *, struct in void softdep_setup_rmdir(struct inode *, struct inode *); void softdep_setup_unlink(struct inode *, struct inode *); void softdep_revert_create(struct inode *, struct inode *); -void softdep_revert_dotdot_link(struct inode *, struct inode *); void softdep_revert_link(struct inode *, struct inode *); void softdep_revert_mkdir(struct inode *, struct inode *); void softdep_revert_rmdir(struct inode *, struct inode *); Index: /usr/src/sys/ufs/ufs/ufsmount.h =================================================================== --- /usr/src/sys/ufs/ufs/ufsmount.h (revision 256095) +++ /usr/src/sys/ufs/ufs/ufsmount.h (working copy) @@ -78,19 +78,7 @@ struct ufsmount { u_long um_seqinc; /* inc between seq blocks */ struct mtx um_lock; /* Protects ufsmount & fs */ pid_t um_fsckpid; /* PID permitted fsck sysctls */ - long um_numindirdeps; /* outstanding indirdeps */ - struct workhead softdep_workitem_pending; /* softdep work queue */ - struct worklist *softdep_worklist_tail; /* Tail pointer for above */ - struct workhead softdep_journal_pending; /* journal work queue */ - struct worklist *softdep_journal_tail; /* Tail pointer for above */ - struct jblocks *softdep_jblocks; /* Journal block information */ - struct inodedeplst softdep_unlinked; /* Unlinked inodes */ - struct bmsafemaphd softdep_dirtycg; /* Dirty CGs */ - int softdep_on_journal; /* Items on the journal list */ - int softdep_on_worklist; /* Items on the worklist */ - int softdep_deps; /* Total dependency count */ - int softdep_accdeps; /* accumulated dep count */ - int softdep_req; /* Wakeup when deps hits 0. */ + struct mount_softdeps *um_softdep; /* softdep mgmt structure */ struct vnode *um_quotas[MAXQUOTAS]; /* pointer to quota files */ struct ucred *um_cred[MAXQUOTAS]; /* quota file access cred */ time_t um_btime[MAXQUOTAS]; /* block quota time limit */ -- Test scenario: netflix.sh