NetBSD/sys/kern
chris 44d939d150 Fix for biowait hangs, and possibly other condvar hangs. Also should fix
PR kern/38761.

The condvar must access the sleepq with the sleepq lock held, doing so
is causing inconsistent sleepq state to be read.

This is because some accesses to the sleepq don't come via the cv code,
but are call directly into sleepq_changepri and sleepq_lendpri, which take
the sleepq lock, and removes then re-inserts lwps into the sleepq.

Running a build.sh with -j8 now completes on my quad-core, also tested by
Simon@ on a 8-core server and matt@ on a quad-core.

I believe there is room to be more efficient with this, as we now take the
sleepq lock for all cv_broadcast and cv_signal calls. I'll look into this
and post a diff to tech-kern.
2008-06-15 09:56:18 +00:00
..
Make.tags.inc Don't run ctags on unichromreg.h, its #definitions cover important 2008-01-28 18:22:36 +00:00
Makefile
bufq_disksort.c Add a BUFQ_CANCEL() next to BUFQ_PUT() and BUFQ_GET(). 2008-04-30 12:09:02 +00:00
bufq_fcfs.c Add a BUFQ_CANCEL() next to BUFQ_PUT() and BUFQ_GET(). 2008-04-30 12:09:02 +00:00
bufq_priocscan.c add a comment. 2008-05-03 05:18:36 +00:00
bufq_readprio.c Add a BUFQ_CANCEL() next to BUFQ_PUT() and BUFQ_GET(). 2008-04-30 12:09:02 +00:00
cnmagic.c remove some __unused from function parameters. 2006-11-01 10:17:58 +00:00
core_elf32.c Network protocol interrupts can now block on locks, so merge the globals 2008-04-24 15:35:27 +00:00
core_elf64.c
core_netbsd.c PR kern/37917 /bin/ps no longer shows zombies 2008-04-29 16:21:27 +00:00
exec_aout.c
exec_conf.c Remove COMPAT_HPUX. 2007-12-31 13:38:47 +00:00
exec_ecoff.c
exec_elf32.c Don't use proc specificdata for the PAX stuff. Speeds up mmap() and others. 2008-06-03 22:15:14 +00:00
exec_elf64.c
exec_macho.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
exec_script.c Catch up with descriptor handling changes. See kern_descrip.c revision 2008-03-21 21:54:58 +00:00
exec_subr.c Don't needlessly acquire v_interlock. 2008-06-02 16:16:27 +00:00
genlintstub.awk
init_main.c - Put in place module compatibility check against __NetBSD_Version__, 2008-05-31 20:14:38 +00:00
init_sysctl.c Kill devsw_lock and just use specfs_lock. The two would need merging 2008-05-31 21:34:42 +00:00
init_sysent.c Regen. 2008-04-24 11:51:47 +00:00
kern_acct.c Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since 2008-04-24 18:39:20 +00:00
kern_auth.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
kern_cctr.c Reduce ifdefs due to MULTIPROCESSOR slightly. 2008-05-19 17:06:02 +00:00
kern_clock.c Make trap counters per-cpu, like syscalls. 2008-06-01 21:24:15 +00:00
kern_condvar.c Fix for biowait hangs, and possibly other condvar hangs. Also should fix 2008-06-15 09:56:18 +00:00
kern_core.c Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since 2008-04-24 18:39:20 +00:00
kern_cpu.c - vm_page: put listq, pageq into a union alongside a LIST_ENTRY, so we can 2008-06-04 12:45:28 +00:00
kern_descrip.c - Convert hashinit() to use kmem_alloc(). The hash tables can be large 2008-05-05 17:11:16 +00:00
kern_drvctl.c Any time we remove event from the queue make sure we 1. release the 2008-05-30 15:30:37 +00:00
kern_event.c - Convert hashinit() to use kmem_alloc(). The hash tables can be large 2008-05-05 17:11:16 +00:00
kern_exec.c PR kern/38881 execve(2) panic: lock error, with path argument > PATH_MAX 2008-06-06 22:21:11 +00:00
kern_exit.c Most contention on proc_lock is from getppid(), so cache the parent's PID. 2008-06-02 16:18:09 +00:00
kern_fileassoc.c - Convert hashinit() to use kmem_alloc(). The hash tables can be large 2008-05-05 17:11:16 +00:00
kern_fork.c Most contention on proc_lock is from getppid(), so cache the parent's PID. 2008-06-02 16:18:09 +00:00
kern_idle.c Don't call uvm_pageidlezero() if the CPU is marked offline. 2008-06-11 13:42:02 +00:00
kern_ksyms.c For each symtab, remember which symbols have the minimum and maximum value. 2008-02-20 02:30:51 +00:00
kern_kthread.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
kern_ktrace.c Before freeing a ktr_desc, destroy its condition variables. 2008-06-03 05:53:09 +00:00
kern_lkm.c Convert all the system call entry points from: 2007-12-20 23:02:38 +00:00
kern_lock.c LOCKDEBUG: 2008-05-31 13:15:21 +00:00
kern_lwp.c If vfork(), we want the LWP to run fast and on the same CPU 2008-06-02 13:58:07 +00:00
kern_malloc.c Make them compile again. 2008-03-17 17:05:54 +00:00
kern_malloc_debug.c Add missing pmap_update(pmap_kernel()); calls after pmap_kenter_pa and 2008-02-23 16:05:17 +00:00
kern_module.c - Put in place module compatibility check against __NetBSD_Version__, 2008-05-31 20:14:38 +00:00
kern_mutex.c Use __noinline. 2008-05-31 13:31:25 +00:00
kern_ntptime.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
kern_pax.c Fix broken enable test; fixes random coredumps. 2008-06-04 12:26:20 +00:00
kern_physio.c Give bbusy() an interlock argument. If the we need to wait for the buffer, 2008-02-15 13:46:04 +00:00
kern_pmf.c Use 2-clause license. 2008-05-05 00:12:49 +00:00
kern_proc.c Reduce ifdefs due to MULTIPROCESSOR slightly. 2008-05-19 17:06:02 +00:00
kern_prot.c Most contention on proc_lock is from getppid(), so cache the parent's PID. 2008-06-02 16:18:09 +00:00
kern_ras.c Fix error in previous. 2008-06-09 11:49:40 +00:00
kern_resource.c PR kern/38812 race between lwp_exit_switchaway and exit1/coredump 2008-05-31 21:26:01 +00:00
kern_runq.c PR kern/38663 Kernel preemption can't be enabled on x86 because of amd64 2008-05-30 12:18:14 +00:00
kern_rwlock.c Use __noinline. 2008-05-31 13:31:25 +00:00
kern_sig.c Reduce ifdefs due to MULTIPROCESSOR slightly. 2008-05-19 17:06:02 +00:00
kern_sleepq.c PR kern/38812 race between lwp_exit_switchaway and exit1/coredump 2008-05-31 21:26:01 +00:00
kern_softint.c PR kern/38812 race between lwp_exit_switchaway and exit1/coredump 2008-05-31 21:26:01 +00:00
kern_stub.c #error if __HAVE_PREEMPTION && !MULTIPROCESSOR. 2008-05-01 00:20:12 +00:00
kern_subr.c remove the hacks around fakemdrootdev[] which should be unnecessary now 2008-06-11 10:40:21 +00:00
kern_synch.c PR kern/38812 race between lwp_exit_switchaway and exit1/coredump 2008-05-31 21:26:01 +00:00
kern_sysctl.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
kern_tc.c Fix locking botch. Pointed out by kardel@. 2008-05-11 14:42:18 +00:00
kern_time.c Explicitly compute the next interval using 64bit arithmetic, if the time 2008-05-29 15:27:51 +00:00
kern_timeout.c Take the mutex pointer and waiters count out of sleepq_t: the values can 2008-05-26 12:08:38 +00:00
kern_todr.c Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants, 2008-01-20 18:09:03 +00:00
kern_turnstile.c Add a comment to turnstile_block: 2008-05-31 12:03:15 +00:00
kern_uuid.c correct cut and paste error in uuid_dec_be(); le16dec -> be16dec 2008-04-19 18:21:38 +00:00
kern_verifiedexec.c Add missing pmap_update(pmap_kernel()); calls after pmap_kenter_pa and 2008-02-23 16:05:17 +00:00
kern_xxx.c Remove unneeded playing about with kernel_lock. 2008-04-25 11:23:42 +00:00
kgdb_stub.c
makesyscalls.sh - Retire SYCALL_MPSAFE. With the exceptions of darwin and irix emulations, 2008-04-24 11:51:18 +00:00
sched_4bsd.c sched_tick: 2008-05-25 22:04:50 +00:00
sched_m2.c - Make periodical balancing mandatory. 2008-05-19 12:48:54 +00:00
subr_autoconf.c tighten type checking: use device_t instead of void* at some places 2008-06-11 15:56:11 +00:00
subr_blist.c
subr_bufq.c Add a BUFQ_CANCEL() next to BUFQ_PUT() and BUFQ_GET(). 2008-04-30 12:09:02 +00:00
subr_callback.c Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written 2007-12-05 07:06:50 +00:00
subr_debug.c Disable the freecheck stuff atomically so we only get one warning about 2008-04-30 20:20:53 +00:00
subr_devsw.c Correct previous. 2008-06-08 12:23:18 +00:00
subr_disk.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
subr_disk_mbr.c Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
subr_evcnt.c
subr_extent.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
subr_hash.c - Convert hashinit() to use kmem_alloc(). The hash tables can be large 2008-05-05 17:11:16 +00:00
subr_iostat.c Remove pointless COMPAT ifdef. 2008-05-20 16:03:31 +00:00
subr_kmem.c if DEBUG, over-allocate 1 byte to detect overrun. 2008-02-09 12:56:20 +00:00
subr_kobj.c If autoloading a module, don't consider the current working directory. 2008-05-20 19:20:38 +00:00
subr_lockdebug.c Move lib/libkern/rb.h to sys/rb.h, so it can be used by kernel header 2008-06-04 14:31:15 +00:00
subr_log.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
subr_once.c
subr_optstr.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
subr_percpu.c - encrypt/decrypt offsets if DIAGNOSTIC. 2008-05-03 05:31:56 +00:00
subr_pool.c Use __noinline. 2008-05-31 13:31:25 +00:00
subr_prf.c Add printf_tolog(), which writes to the kernel message buffer, 2008-05-31 20:27:24 +00:00
subr_prf2.c tablefull: subr_prf -> subr_prf2 2007-12-30 22:55:21 +00:00
subr_prof.c Convert all the system call entry points from: 2007-12-20 23:02:38 +00:00
subr_specificdata.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
subr_syscall_stats.c Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
subr_tftproot.c Merge the socket locking patch: 2008-04-24 11:38:36 +00:00
subr_time.c reduce #ifdef __HAVE_TIMECOUNTER. 2007-12-22 00:35:32 +00:00
subr_userconf.c
subr_vmem.c - simplify ASSERT_SLEEPABLE. 2008-03-17 08:27:50 +00:00
subr_workqueue.c Replace use of CACHE_LINE_SIZE in some obvious places. 2008-03-27 18:30:15 +00:00
subr_xcall.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
sys_aio.c Adjust and thus unify my license. 2008-05-26 17:45:51 +00:00
sys_descrip.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
sys_generic.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
sys_lwp.c Take the mutex pointer and waiters count out of sleepq_t: the values can 2008-05-26 12:08:38 +00:00
sys_module.c If autoloading a module, don't consider the current working directory. 2008-05-20 19:20:38 +00:00
sys_mqueue.c Network protocol interrupts can now block on locks, so merge the globals 2008-04-24 15:35:27 +00:00
sys_pipe.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
sys_pmc.c Make ntp, pmc, reboot, sysarch, time syscalls MPSAFE. 2008-04-21 12:56:30 +00:00
sys_process.c sys_ptrace: fix a locking botch. PR/38649 from Martin Husemann. 2008-05-13 09:16:11 +00:00
sys_pset.c Adjust and thus unify my license. 2008-05-26 17:45:51 +00:00
sys_sched.c If converting a process/thread from SCHED_OTHER to a realtime thread, 2008-05-25 23:34:24 +00:00
sys_select.c Check the result of allocation in the cases where size is passed by user. 2008-06-04 13:02:41 +00:00
sys_sig.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
sys_socket.c kern/38502 ifconfig wi0 hangs 2008-04-29 18:35:14 +00:00
sys_syscall.c Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
syscalls.c Regen. 2008-04-24 11:51:47 +00:00
syscalls.conf bring some stuff from time_t=64... 2008-03-22 15:11:01 +00:00
syscalls.master Mark pread/pwrite rump syscalls. 2008-05-29 12:01:37 +00:00
sysv_ipc.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
sysv_msg.c Make msgsnd return EINVAL instead of 0, when the value of mtype is 2008-05-22 11:25:54 +00:00
sysv_sem.c - Make semctl SETVAL/SETALL commands validate the semaphore value to 2008-05-06 20:25:09 +00:00
sysv_shm.c shmrealloc: destroy condition variables before freeing them. 2008-05-31 13:11:14 +00:00
tty.c Properly fix the "hanging in tty" bug that was worked around with cv_wakeup() 2008-05-25 19:22:21 +00:00
tty_bsdpty.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tty_conf.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tty_ptm.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tty_pty.c Properly fix the "hanging in tty" bug that was worked around with cv_wakeup() 2008-05-25 19:22:21 +00:00
tty_subr.c Properly fix the "hanging in tty" bug that was worked around with cv_wakeup() 2008-05-25 19:22:21 +00:00
tty_tty.c Network protocol interrupts can now block on locks, so merge the globals 2008-04-24 15:35:27 +00:00
uipc_domain.c Merge the socket locking patch: 2008-04-24 11:38:36 +00:00
uipc_mbuf.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
uipc_mbuf2.c Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
uipc_proto.c Merge the socket locking patch: 2008-04-24 11:38:36 +00:00
uipc_sem.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
uipc_socket.c Disable zero copy if MULTIPROCESSOR, until it is fixed: 2008-05-28 21:01:42 +00:00
uipc_socket2.c There can be existing waiters on a socket's condition variables when we 2008-06-10 11:49:11 +00:00
uipc_syscalls.c do_sys_accept: release the reference to sock in few error paths. 2008-05-30 09:49:01 +00:00
uipc_usrreq.c There can be existing waiters on a socket's condition variables when we 2008-06-10 11:49:11 +00:00
vfs_bio.c - Make getiobuf() return buffers marked BUSY. 2008-06-06 12:49:15 +00:00
vfs_cache.c vfs_cache: 2008-06-03 15:50:22 +00:00
vfs_getcwd.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
vfs_hooks.c Convert file systems to dynamically attach with the new module interface. 2008-05-10 02:26:09 +00:00
vfs_init.c Convert file systems to dynamically attach with the new module interface. 2008-05-10 02:26:09 +00:00
vfs_lockf.c PR kern/38355 lockf deadlock detection is broken after vmlocking 2008-05-28 13:35:32 +00:00
vfs_lookup.c PR kern/38141 lookup/vfs_busy acquire rwlock recursively 2008-05-06 18:43:44 +00:00
vfs_subr.c Avoid "free vnode isn't" assertion. 2008-06-05 12:32:57 +00:00
vfs_subr2.c use PNBUF_* instead of malloc 2008-05-26 02:27:36 +00:00
vfs_syscalls.c In mount_domount() there is no need to initialise "mp" if the first time 2008-06-10 14:14:01 +00:00
vfs_trans.c Remove a bad assertion from last commit. 2008-05-16 14:08:56 +00:00
vfs_vnops.c Don't needlessly acquire v_interlock. 2008-06-02 16:00:33 +00:00
vfs_xattr.c Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
vnode_if.c Regen. 2008-01-25 14:32:46 +00:00
vnode_if.sh Reduce ifdefs due to MULTIPROCESSOR slightly. 2008-05-19 17:06:02 +00:00
vnode_if.src Remove VOP_LEASE. Discussed on tech-kern. 2008-01-25 14:32:11 +00:00