Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Freelist cache: drain using a high-priority xcall an...
details: https://anonhg.NetBSD.org/src/rev/b003e7ed1e2d
branches: trunk
changeset: 967981:b003e7ed1e2d
user: ad <ad%NetBSD.org@localhost>
date: Mon Dec 30 17:47:06 2019 +0000
description:
Freelist cache: drain using a high-priority xcall and re-enable now that
the pagedaemon starvation problem should be fixed.
diffstat:
sys/uvm/uvm_pgflcache.c | 22 +++++-----------------
1 files changed, 5 insertions(+), 17 deletions(-)
diffs (73 lines):
diff -r 1e8f3140f9eb -r b003e7ed1e2d sys/uvm/uvm_pgflcache.c
--- a/sys/uvm/uvm_pgflcache.c Mon Dec 30 17:45:53 2019 +0000
+++ b/sys/uvm/uvm_pgflcache.c Mon Dec 30 17:47:06 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_pgflcache.c,v 1.3 2019/12/29 15:45:28 ad Exp $ */
+/* $NetBSD: uvm_pgflcache.c,v 1.4 2019/12/30 17:47:06 ad Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pgflcache.c,v 1.3 2019/12/29 15:45:28 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pgflcache.c,v 1.4 2019/12/30 17:47:06 ad Exp $");
#include "opt_uvm.h"
#include "opt_multiprocessor.h"
@@ -99,9 +99,7 @@
};
static kmutex_t uvm_pgflcache_lock;
-static kcondvar_t uvm_pgflcache_cv;
static int uvm_pgflcache_sem;
-static bool uvm_pgflcache_draining;
/*
* uvm_pgflcache_fill: fill specified freelist/color from global list
@@ -318,17 +316,9 @@
/* First one in starts draining. Everyone else waits. */
mutex_enter(&uvm_pgflcache_lock);
if (uvm_pgflcache_sem++ == 0) {
- uvm_pgflcache_draining = true;
- mutex_exit(&uvm_pgflcache_lock);
- where = xc_broadcast(0, uvm_pgflcache_fini_cpu, NULL, NULL);
+ where = xc_broadcast(XC_HIGHPRI, uvm_pgflcache_fini_cpu,
+ (void *)1, NULL);
xc_wait(where);
- mutex_enter(&uvm_pgflcache_lock);
- uvm_pgflcache_draining = false;
- cv_broadcast(&uvm_pgflcache_cv);
- } else {
- while (uvm_pgflcache_draining) {
- cv_wait(&uvm_pgflcache_cv, &uvm_pgflcache_lock);
- }
}
mutex_exit(&uvm_pgflcache_lock);
}
@@ -349,7 +339,6 @@
/* Last guy out takes care of business. */
mutex_enter(&uvm_pgflcache_lock);
- KASSERT(!uvm_pgflcache_draining);
KASSERT(uvm_pgflcache_sem > 0);
if (uvm_pgflcache_sem-- > 1) {
mutex_exit(&uvm_pgflcache_lock);
@@ -406,7 +395,7 @@
}
/* Kick it into action. */
- /* uvm_pgflcache_resume(); */
+ uvm_pgflcache_resume();
}
/*
@@ -419,7 +408,6 @@
uvm_pgflcache_sem = 1;
mutex_init(&uvm_pgflcache_lock, MUTEX_DEFAULT, IPL_NONE);
- cv_init(&uvm_pgflcache_cv, "flcache");
}
#else /* MULTIPROCESSOR */
Home |
Main Index |
Thread Index |
Old Index