summaryrefslogtreecommitdiff
path: root/sys/src/9/omap
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/omap
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/omap')
-rw-r--r--sys/src/9/omap/mmu.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/src/9/omap/mmu.c b/sys/src/9/omap/mmu.c
index d427f1d76..12383c962 100644
--- a/sys/src/9/omap/mmu.c
+++ b/sys/src/9/omap/mmu.c
@@ -234,20 +234,12 @@ flushmmu(void)
void
mmurelease(Proc* proc)
{
- Page *page, *next;
-
/* write back dirty and invalidate l1 caches */
cacheuwbinv();
mmul2empty(proc, 0);
- for(page = proc->mmul2cache; page != nil; page = next){
- next = page->next;
- if(--page->ref)
- panic("mmurelease: page->ref %ld", page->ref);
- pagechainhead(page);
- }
- if(proc->mmul2cache != nil)
- pagechaindone();
+
+ freepages(proc->mmul2cache, nil, 0);
proc->mmul2cache = nil;
mmul1empty();