# HG changeset patch # User Joshua M. Clulow # Date 1600750743 25200 # Node ID af8fee8a8d70584355ddc830711c8af4ef935aa8 # Parent 3757e6a94e621859167e45ab86d89101121354f2 13094 systems have more kmem caches than they used to Reviewed by: Andy Fiddaman Reviewed by: Jason King Reviewed by: Peter Tribble Approved by: Hans Rosenfeld diff -r 3757e6a94e62 -r af8fee8a8d70 usr/src/uts/common/os/kmem.c --- a/usr/src/uts/common/os/kmem.c Mon Sep 21 21:58:47 2020 -0700 +++ b/usr/src/uts/common/os/kmem.c Mon Sep 21 21:59:03 2020 -0700 @@ -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 @@ 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