1/*-
2 * Copyright (c) 2004, 2005,
3 * Bosko Milekic <bmilekic@FreeBSD.org>. All rights reserved.
4 * Copyright (c) 2002, 2003, 2004, 2005,
5 * Jeffrey Roberson <jeff@FreeBSD.org>. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 11 unchanged lines hidden (view full) ---
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/vm/uma.h 147996 2005-07-14 16:35:13Z rwatson $
29 *
30 */
31
32/*
33 * uma.h - External definitions for the Universal Memory Allocator
34 *
35*/
36
--- 467 unchanged lines hidden (view full) ---
504 * zone The UMA_ZONE_REFCNT zone to which the item belongs.
505 * item The address of the item for which we want a refcnt.
506 *
507 * Returns:
508 * A pointer to a u_int32_t reference counter.
509 */
510u_int32_t *uma_find_refcnt(uma_zone_t zone, void *item);
511
512/*
513 * Exported statistics structures to be used by user space monitoring tools.
514 * Statistics stream consusts of a uma_stream_header, followed by a series of
515 * alternative uma_type_header and uma_type_stat structures. Statistics
516 * structures
517 */
518#define UMA_STREAM_VERSION 0x00000001
519struct uma_stream_header {
520 u_int32_t ush_version; /* Stream format version. */
521 u_int32_t ush_maxcpus; /* Value of MAXCPU for stream. */
522 u_int32_t ush_count; /* Number of records. */
523 u_int32_t _ush_pad; /* Pad/reserved field. */
524};
525
526#define UMA_MAX_NAME 32
527struct uma_type_header {
528 /*
529 * Static per-zone data, some extracted from the supporting keg.
530 */
531 char uth_name[UMA_MAX_NAME];
532 u_int32_t uth_align; /* Keg: alignment. */
533 u_int32_t uth_size; /* Keg: requested size of item. */
534 u_int32_t uth_rsize; /* Keg: real size of item. */
535 u_int32_t uth_maxpages; /* Keg: maximum number of pages. */
536 u_int32_t uth_limit; /* Keg: max items to allocate. */
537
538 /*
539 * Current dynamic zone/keg-derived statistics.
540 */
541 u_int32_t uth_pages; /* Keg: pages allocated. */
542 u_int32_t uth_keg_free; /* Keg: items free. */
543 u_int32_t uth_zone_free; /* Zone: items free. */
544 u_int32_t uth_bucketsize; /* Zone: desired bucket size. */
545 u_int32_t _uth_reserved0; /* Reserved. */
546 u_int64_t uth_allocs; /* Zone: number of allocations. */
547 u_int64_t uth_frees; /* Zone: number of frees. */
548 u_int64_t _uth_reserved1[4]; /* Reserved. */
549
550};
551
552struct uma_percpu_stat {
553 u_int64_t ups_allocs; /* Cache: number of alloctions. */
554 u_int64_t ups_frees; /* Cache: number of frees. */
555 u_int64_t ups_cache_free; /* Cache: free items in cache. */
556 u_int64_t _ups_reserved[5]; /* Reserved. */
557};
558
559#endif
2 * Copyright (c) 2004, 2005,
3 * Bosko Milekic <bmilekic@FreeBSD.org>. All rights reserved.
4 * Copyright (c) 2002, 2003, 2004, 2005,
5 * Jeffrey Roberson <jeff@FreeBSD.org>. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 11 unchanged lines hidden (view full) ---
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/vm/uma.h 147996 2005-07-14 16:35:13Z rwatson $
29 *
30 */
31
32/*
33 * uma.h - External definitions for the Universal Memory Allocator
34 *
35*/
36
--- 467 unchanged lines hidden (view full) ---
504 * zone The UMA_ZONE_REFCNT zone to which the item belongs.
505 * item The address of the item for which we want a refcnt.
506 *
507 * Returns:
508 * A pointer to a u_int32_t reference counter.
509 */
510u_int32_t *uma_find_refcnt(uma_zone_t zone, void *item);
511
512/*
513 * Exported statistics structures to be used by user space monitoring tools.
514 * Statistics stream consusts of a uma_stream_header, followed by a series of
515 * alternative uma_type_header and uma_type_stat structures. Statistics
516 * structures
517 */
518#define UMA_STREAM_VERSION 0x00000001
519struct uma_stream_header {
520 u_int32_t ush_version; /* Stream format version. */
521 u_int32_t ush_maxcpus; /* Value of MAXCPU for stream. */
522 u_int32_t ush_count; /* Number of records. */
523 u_int32_t _ush_pad; /* Pad/reserved field. */
524};
525
526#define UMA_MAX_NAME 32
527struct uma_type_header {
528 /*
529 * Static per-zone data, some extracted from the supporting keg.
530 */
531 char uth_name[UMA_MAX_NAME];
532 u_int32_t uth_align; /* Keg: alignment. */
533 u_int32_t uth_size; /* Keg: requested size of item. */
534 u_int32_t uth_rsize; /* Keg: real size of item. */
535 u_int32_t uth_maxpages; /* Keg: maximum number of pages. */
536 u_int32_t uth_limit; /* Keg: max items to allocate. */
537
538 /*
539 * Current dynamic zone/keg-derived statistics.
540 */
541 u_int32_t uth_pages; /* Keg: pages allocated. */
542 u_int32_t uth_keg_free; /* Keg: items free. */
543 u_int32_t uth_zone_free; /* Zone: items free. */
544 u_int32_t uth_bucketsize; /* Zone: desired bucket size. */
545 u_int32_t _uth_reserved0; /* Reserved. */
546 u_int64_t uth_allocs; /* Zone: number of allocations. */
547 u_int64_t uth_frees; /* Zone: number of frees. */
548 u_int64_t _uth_reserved1[4]; /* Reserved. */
549
550};
551
552struct uma_percpu_stat {
553 u_int64_t ups_allocs; /* Cache: number of alloctions. */
554 u_int64_t ups_frees; /* Cache: number of frees. */
555 u_int64_t ups_cache_free; /* Cache: free items in cache. */
556 u_int64_t _ups_reserved[5]; /* Reserved. */
557};
558
559#endif