summaryrefslogtreecommitdiff
path: root/sys/src/9/bcm64
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/bcm64
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/bcm64')
-rw-r--r--sys/src/9/bcm64/mmu.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/src/9/bcm64/mmu.c b/sys/src/9/bcm64/mmu.c
index 4c664554b..8538369fa 100644
--- a/sys/src/9/bcm64/mmu.c
+++ b/sys/src/9/bcm64/mmu.c
@@ -518,20 +518,10 @@ mmuswitch(Proc *p)
void
mmurelease(Proc *p)
{
- Page *t;
-
mmuswitch(nil);
mmufree(p);
-
- if((t = p->mmufree) != nil){
- do {
- p->mmufree = t->next;
- if(--t->ref != 0)
- panic("mmurelease: bad page ref");
- pagechainhead(t);
- } while((t = p->mmufree) != nil);
- pagechaindone();
- }
+ freepages(p->mmufree, nil, 0);
+ p->mmufree = nil;
}
void