diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-05-16 04:24:15 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-05-16 04:24:15 +0000 |
commit | 498e6dd13db52faa65ea8d2379a302849fb2af88 (patch) | |
tree | 5e7106d315a364b141f239b67b54cc6adc02e4f7 /sys/uvm/uvm_map.c | |
parent | bbee70dba3015fe7cf8d9daa749aeb086ba620b8 (diff) |
Handle a bit more work without taking the kernel lock. This should avoid
taking the kernel lock on when operating on the kernel_map when called from
all kernel memory allocation interfaces.
ok visa@, mlarkin@
Diffstat (limited to 'sys/uvm/uvm_map.c')
-rw-r--r-- | sys/uvm/uvm_map.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 2638d821faf..497bc78195a 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.243 2019/04/23 13:35:12 visa Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.244 2019/05/16 04:24:14 kettenis Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -1538,9 +1538,19 @@ uvm_mapent_tryjoin(struct vm_map *map, struct vm_map_entry *entry, void uvm_unmap_detach(struct uvm_map_deadq *deadq, int flags) { - struct vm_map_entry *entry; + struct vm_map_entry *entry, *tmp; int waitok = flags & UVM_PLA_WAITOK; + TAILQ_FOREACH_SAFE(entry, deadq, dfree.deadq, tmp) { + /* Skip entries for which we have to grab the kernel lock. */ + if (entry->aref.ar_amap || UVM_ET_ISSUBMAP(entry) || + UVM_ET_ISOBJ(entry)) + continue; + + TAILQ_REMOVE(deadq, entry, dfree.deadq); + uvm_mapent_free(entry); + } + if (TAILQ_EMPTY(deadq)) return; |