diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-05-17 08:13:34 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-05-17 08:13:34 +0000 |
commit | 2ab17b4e0fa3d30ad4a1e094f0c3d16e1fcd29f1 (patch) | |
tree | 992c36164ea27ee93721ea402116b4ed31e675bd /sys/uvm/uvm_map.c | |
parent | 9fe5230f2d741ced87b71db9a7f7925a0ef86b44 (diff) |
Raise "uvm_map_entry_kmem_pool" IPL level to IPL_VM to prevent a deadlock.
A deadlock can occur when the uvm_km_thread(), running without KERNEL_LOCK()
is interrupted by and non-MPSAFE handler while holding the pool's mutex. At
that moment if another CPU is holding the KERNEL_LOCK() and wants to grab the
pool mutex, like in sys_kbind(), kaboom!
This is a temporaty solution, a more generate approach regarding mutexes and
un-KERNEL_LOCK()ed threads is beeing discussed.
Deadlock reported by sthen@, ok kettenis@
Diffstat (limited to 'sys/uvm/uvm_map.c')
-rw-r--r-- | sys/uvm/uvm_map.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 564d1f645c5..911c175844c 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.230 2017/04/20 14:13:00 visa Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.231 2017/05/17 08:13:33 mpi Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -2798,7 +2798,7 @@ uvm_map_init(void) pool_init(&uvm_map_entry_pool, sizeof(struct vm_map_entry), 0, IPL_VM, PR_WAITOK, "vmmpepl", NULL); pool_init(&uvm_map_entry_kmem_pool, sizeof(struct vm_map_entry), 0, - IPL_NONE, 0, "vmmpekpl", NULL); + IPL_VM, 0, "vmmpekpl", NULL); pool_sethiwat(&uvm_map_entry_pool, 8192); uvm_addr_init(); |