summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/kmem.c
diff options
context:
space:
mode:
authorahrens <none@none>2005-10-31 11:33:35 -0800
committerahrens <none@none>2005-10-31 11:33:35 -0800
commitfa9e4066f08beec538e775443c5be79dd423fcab (patch)
tree576d99665e57bb7cb70584431adb08c14d47e3ce /usr/src/uts/common/os/kmem.c
parentf1b64740276f67fc6914c1d855f2af601efe99ac (diff)
downloadillumos-joyent-fa9e4066f08beec538e775443c5be79dd423fcab.tar.gz
PSARC 2002/240 ZFS
6338653 Integrate ZFS PSARC 2004/652 - DKIOCFLUSH 5096886 Write caching disks need mechanism to flush cache to physical media
Diffstat (limited to 'usr/src/uts/common/os/kmem.c')
-rw-r--r--usr/src/uts/common/os/kmem.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/usr/src/uts/common/os/kmem.c b/usr/src/uts/common/os/kmem.c
index 7ae9d5f16b..be7ba8b0cc 100644
--- a/usr/src/uts/common/os/kmem.c
+++ b/usr/src/uts/common/os/kmem.c
@@ -1682,6 +1682,21 @@ kmem_cache_magazine_enable(kmem_cache_t *cp)
}
/*
+ * Reap (almost) everything right now. See kmem_cache_magazine_purge()
+ * for explanation of the back-to-back kmem_depot_ws_update() calls.
+ */
+void
+kmem_cache_reap_now(kmem_cache_t *cp)
+{
+ kmem_depot_ws_update(cp);
+ kmem_depot_ws_update(cp);
+
+ (void) taskq_dispatch(kmem_taskq,
+ (task_func_t *)kmem_depot_ws_reap, cp, TQ_SLEEP);
+ taskq_wait(kmem_taskq);
+}
+
+/*
* Recompute a cache's magazine size. The trade-off is that larger magazines
* provide a higher transfer rate with the depot, while smaller magazines
* reduce memory consumption. Magazine resizing is an expensive operation;
@@ -1978,6 +1993,15 @@ kmem_maxavail(void)
return ((size_t)ptob(MAX(MIN(pmem, vmem), 0)));
}
+/*
+ * Indicate whether memory-intensive kmem debugging is enabled.
+ */
+int
+kmem_debugging(void)
+{
+ return (kmem_flags & (KMF_AUDIT | KMF_REDZONE));
+}
+
kmem_cache_t *
kmem_cache_create(
char *name, /* descriptive name for this cache */