summaryrefslogtreecommitdiff
path: root/sys/src/9/xen
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-12-22 16:29:55 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2020-12-22 16:29:55 +0100
commit29f60cace1a71edd730c60ddac8dfbd962741038 (patch)
tree11967087ec1657d52a90c7508cf73e2e1bcc9307 /sys/src/9/xen
parent2fb5fbbd73a1c861bdc7326ece8035ffb35f7093 (diff)
kernel: avoid palloc lock during mmurelease()
Previously, mmurelease() was always called with palloc spinlock held. This is unneccesary for some mmurelease() implementations as they wont release pages to the palloc pool. This change removes pagechainhead() and pagechaindone() and replaces them with just freepages() call, which aquires the palloc lock internally as needed. freepages() avoids holding the palloc lock while walking the linked list of pages, avoding some lock contention.
Diffstat (limited to 'sys/src/9/xen')
-rw-r--r--sys/src/9/xen/mmu.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/src/9/xen/mmu.c b/sys/src/9/xen/mmu.c
index 1a5c3d067..250d08371 100644
--- a/sys/src/9/xen/mmu.c
+++ b/sys/src/9/xen/mmu.c
@@ -282,15 +282,8 @@ mmurelease(Proc* proc)
}
}
- for(page = proc->mmufree; page; page = next){
- next = page->next;
- if(--page->ref)
- panic("mmurelease: page->ref %ld\n", page->ref);
- pagechainhead(page);
- }
- if(proc->mmufree)
- pagechaindone();
- proc->mmufree = 0;
+ freepages(proc->mmufree, nil, 0);
+ proc->mmufree = nil;
}
static Page*