summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/os/kmem.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr/src/uts/common/os/kmem.c b/usr/src/uts/common/os/kmem.c
index 1bb90a27a7..207d529146 100644
--- a/usr/src/uts/common/os/kmem.c
+++ b/usr/src/uts/common/os/kmem.c
@@ -23,6 +23,7 @@
* Copyright (c) 2012, 2017 by Delphix. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright 2018, Joyent, Inc.
+ * Copyright 2020 Oxide Computer Company
*/
/*
@@ -4529,8 +4530,21 @@ void
kmem_thread_init(void)
{
kmem_move_init();
+
+ /*
+ * This taskq is used for various kmem maintenance functions, including
+ * kmem_reap(). When maintenance is required on every cache,
+ * kmem_cache_applyall() dispatches one task per cache onto this queue.
+ *
+ * In the case of kmem_reap(), the system may be under increasingly
+ * dire memory pressure and may not be able to allocate a new task
+ * entry. The count of entries to prepopulate (below) should cover at
+ * least as many caches as we generally expect to exist on the system
+ * so that they may all be scheduled for reaping under those
+ * conditions.
+ */
kmem_taskq = taskq_create_instance("kmem_taskq", 0, 1, minclsyspri,
- 300, INT_MAX, TASKQ_PREPOPULATE);
+ 600, INT_MAX, TASKQ_PREPOPULATE);
}
void