opensolaris_kmem.c (331017) | opensolaris_kmem.c (332528) |
---|---|
1/*- 2 * Copyright (c) 2006-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c 331017 2018-03-15 19:08:33Z kevans $"); | 28__FBSDID("$FreeBSD: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c 332528 2018-04-16 03:38:37Z mav $"); |
29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33#include <sys/malloc.h> 34#include <sys/kmem.h> 35#include <sys/debug.h> 36#include <sys/mutex.h> --- 170 unchanged lines hidden (view full) --- 207 uma_zfree_arg(cache->kc_zone, buf, cache); 208#else 209 if (cache->kc_destructor != NULL) 210 kmem_std_destructor(buf, cache->kc_size, cache); 211 kmem_free(buf, cache->kc_size); 212#endif 213} 214 | 29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33#include <sys/malloc.h> 34#include <sys/kmem.h> 35#include <sys/debug.h> 36#include <sys/mutex.h> --- 170 unchanged lines hidden (view full) --- 207 uma_zfree_arg(cache->kc_zone, buf, cache); 208#else 209 if (cache->kc_destructor != NULL) 210 kmem_std_destructor(buf, cache->kc_size, cache); 211 kmem_free(buf, cache->kc_size); 212#endif 213} 214 |
215/* 216 * Allow our caller to determine if there are running reaps. 217 * 218 * This call is very conservative and may return B_TRUE even when 219 * reaping activity isn't active. If it returns B_FALSE, then reaping 220 * activity is definitely inactive. 221 */ 222boolean_t 223kmem_cache_reap_active(void) 224{ 225 226 return (B_FALSE); 227} 228 229/* 230 * Reap (almost) everything soon. 231 * 232 * Note: this does not wait for the reap-tasks to complete. Caller 233 * should use kmem_cache_reap_active() (above) and/or moderation to 234 * avoid scheduling too many reap-tasks. 235 */ |
|
215#ifdef _KERNEL 216void | 236#ifdef _KERNEL 237void |
217kmem_cache_reap_now(kmem_cache_t *cache) | 238kmem_cache_reap_soon(kmem_cache_t *cache) |
218{ 219#ifndef KMEM_DEBUG 220 zone_drain(cache->kc_zone); 221#endif 222} 223 224void 225kmem_reap(void) 226{ 227 uma_reclaim(); 228} 229#else 230void | 239{ 240#ifndef KMEM_DEBUG 241 zone_drain(cache->kc_zone); 242#endif 243} 244 245void 246kmem_reap(void) 247{ 248 uma_reclaim(); 249} 250#else 251void |
231kmem_cache_reap_now(kmem_cache_t *cache __unused) | 252kmem_cache_reap_soon(kmem_cache_t *cache __unused) |
232{ 233} 234 235void 236kmem_reap(void) 237{ 238} 239#endif --- 36 unchanged lines hidden --- | 253{ 254} 255 256void 257kmem_reap(void) 258{ 259} 260#endif --- 36 unchanged lines hidden --- |