Deleted Added
full compact
uma_int.h (251709) uma_int.h (251826)
1/*-
2 * Copyright (c) 2002-2005, 2009, 2013 Jeffrey Roberson <jeff@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Bosko Milekic <bmilekic@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
1/*-
2 * Copyright (c) 2002-2005, 2009, 2013 Jeffrey Roberson <jeff@FreeBSD.org>
3 * Copyright (c) 2004, 2005 Bosko Milekic <bmilekic@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/vm/uma_int.h 251709 2013-06-13 21:05:38Z jeff $
27 * $FreeBSD: head/sys/vm/uma_int.h 251826 2013-06-17 03:43:47Z jeff $
28 *
29 */
30
31/*
32 * This file includes definitions, structures, prototypes, and inlines that
33 * should not be used outside of the actual implementation of UMA.
34 */
35

--- 255 unchanged lines hidden (view full) ---

291
292 LIST_HEAD(,uma_klink) uz_kegs; /* List of kegs. */
293 struct uma_klink uz_klink; /* klink for first keg. */
294
295 uma_slaballoc uz_slab; /* Allocate a slab from the backend. */
296 uma_ctor uz_ctor; /* Constructor for each allocation */
297 uma_dtor uz_dtor; /* Destructor */
298 uma_init uz_init; /* Initializer for each item */
28 *
29 */
30
31/*
32 * This file includes definitions, structures, prototypes, and inlines that
33 * should not be used outside of the actual implementation of UMA.
34 */
35

--- 255 unchanged lines hidden (view full) ---

291
292 LIST_HEAD(,uma_klink) uz_kegs; /* List of kegs. */
293 struct uma_klink uz_klink; /* klink for first keg. */
294
295 uma_slaballoc uz_slab; /* Allocate a slab from the backend. */
296 uma_ctor uz_ctor; /* Constructor for each allocation */
297 uma_dtor uz_dtor; /* Destructor */
298 uma_init uz_init; /* Initializer for each item */
299 uma_fini uz_fini; /* Discards memory */
299 uma_fini uz_fini; /* Finalizer for each item. */
300 uma_import uz_import; /* Import new memory to cache. */
301 uma_release uz_release; /* Release memory from cache. */
302 void *uz_arg; /* Import/release argument. */
300
301 uint32_t uz_flags; /* Flags inherited from kegs */
302 uint32_t uz_size; /* Size inherited from kegs */
303
303
304 uint32_t uz_flags; /* Flags inherited from kegs */
305 uint32_t uz_size; /* Size inherited from kegs */
306
304 uint64_t uz_allocs UMA_ALIGN; /* Total number of allocations */
305 uint64_t uz_frees; /* Total number of frees */
306 uint64_t uz_fails; /* Total number of alloc failures */
307 volatile u_long uz_allocs UMA_ALIGN; /* Total number of allocations */
308 volatile u_long uz_fails; /* Total number of alloc failures */
309 volatile u_long uz_frees; /* Total number of frees */
307 uint64_t uz_sleeps; /* Total number of alloc sleeps */
308 uint16_t uz_fills; /* Outstanding bucket fills */
309 uint16_t uz_count; /* Highest amount of items in bucket */
310
311 /* The next three fields are used to print a rate-limited warnings. */
312 const char *uz_warning; /* Warning to print on failure */
313 struct timeval uz_ratecheck; /* Warnings rate-limiting */
314

--- 13 unchanged lines hidden (view full) ---

328#define UMA_ZFLAG_PRIVALLOC 0x10000000 /* Use uz_allocf. */
329#define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */
330#define UMA_ZFLAG_FULL 0x40000000 /* Reached uz_maxpages */
331#define UMA_ZFLAG_CACHEONLY 0x80000000 /* Don't ask VM for buckets. */
332
333#define UMA_ZFLAG_INHERIT (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY | \
334 UMA_ZFLAG_BUCKET)
335
310 uint64_t uz_sleeps; /* Total number of alloc sleeps */
311 uint16_t uz_fills; /* Outstanding bucket fills */
312 uint16_t uz_count; /* Highest amount of items in bucket */
313
314 /* The next three fields are used to print a rate-limited warnings. */
315 const char *uz_warning; /* Warning to print on failure */
316 struct timeval uz_ratecheck; /* Warnings rate-limiting */
317

--- 13 unchanged lines hidden (view full) ---

331#define UMA_ZFLAG_PRIVALLOC 0x10000000 /* Use uz_allocf. */
332#define UMA_ZFLAG_INTERNAL 0x20000000 /* No offpage no PCPU. */
333#define UMA_ZFLAG_FULL 0x40000000 /* Reached uz_maxpages */
334#define UMA_ZFLAG_CACHEONLY 0x80000000 /* Don't ask VM for buckets. */
335
336#define UMA_ZFLAG_INHERIT (UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY | \
337 UMA_ZFLAG_BUCKET)
338
339static inline uma_keg_t
340zone_first_keg(uma_zone_t zone)
341{
342
343 return (LIST_FIRST(&zone->uz_kegs)->kl_keg);
344}
345
336#undef UMA_ALIGN
337
338#ifdef _KERNEL
339/* Internal prototypes */
340static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data);
341void *uma_large_malloc(int size, int wait);
342void uma_large_free(uma_slab_t slab);
343

--- 89 unchanged lines hidden ---
346#undef UMA_ALIGN
347
348#ifdef _KERNEL
349/* Internal prototypes */
350static __inline uma_slab_t hash_sfind(struct uma_hash *hash, uint8_t *data);
351void *uma_large_malloc(int size, int wait);
352void uma_large_free(uma_slab_t slab);
353

--- 89 unchanged lines hidden ---