4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #ifndef _VM_SEG_KMEM_H
  27 #define _VM_SEG_KMEM_H
  28 
  29 
  30 #ifdef  __cplusplus
  31 extern "C" {
  32 #endif
  33 
  34 #include <sys/types.h>
  35 #include <sys/vnode.h>
  36 #include <sys/vmem.h>
  37 #include <vm/as.h>
  38 #include <vm/seg.h>
  39 #include <vm/page.h>
  40 
  41 /*
  42  * VM - Kernel Segment Driver
  43  */
 
 119         uint64_t        allocs_throttled;
 120         uint64_t        allocs_limited;
 121         uint64_t        alloc_bytes_failed;
 122 } segkmem_lpcb_t;
 123 
 124 extern void     *segkmem_alloc_lp(vmem_t *, size_t *, size_t, int);
 125 extern void     segkmem_free_lp(vmem_t *, void *, size_t);
 126 extern int      segkmem_lpsetup();
 127 extern void     segkmem_heap_lp_init(void);
 128 
 129 extern size_t   segkmem_lpsize;
 130 extern int      segkmem_lpszc;
 131 extern size_t   segkmem_heaplp_quantum;
 132 extern size_t   segkmem_kmemlp_max;
 133 
 134 #define SEGKMEM_USE_LARGEPAGES (segkmem_lpsize > PAGESIZE)
 135 
 136 #define IS_KMEM_VA_LARGEPAGE(vaddr)                                     \
 137         (((vaddr) >= heap_lp_base) && ((vaddr) < heap_lp_end))
 138 
 139 #endif  /* _KERNEL */
 140 
 141 #ifdef  __cplusplus
 142 }
 143 #endif
 144 
 145 #endif  /* _VM_SEG_KMEM_H */
  | 
 
 
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  * Copyright 2016 Joyent, Inc.
  25  */
  26 
  27 #ifndef _VM_SEG_KMEM_H
  28 #define _VM_SEG_KMEM_H
  29 
  30 
  31 #ifdef  __cplusplus
  32 extern "C" {
  33 #endif
  34 
  35 #include <sys/types.h>
  36 #include <sys/vnode.h>
  37 #include <sys/vmem.h>
  38 #include <vm/as.h>
  39 #include <vm/seg.h>
  40 #include <vm/page.h>
  41 
  42 /*
  43  * VM - Kernel Segment Driver
  44  */
 
 120         uint64_t        allocs_throttled;
 121         uint64_t        allocs_limited;
 122         uint64_t        alloc_bytes_failed;
 123 } segkmem_lpcb_t;
 124 
 125 extern void     *segkmem_alloc_lp(vmem_t *, size_t *, size_t, int);
 126 extern void     segkmem_free_lp(vmem_t *, void *, size_t);
 127 extern int      segkmem_lpsetup();
 128 extern void     segkmem_heap_lp_init(void);
 129 
 130 extern size_t   segkmem_lpsize;
 131 extern int      segkmem_lpszc;
 132 extern size_t   segkmem_heaplp_quantum;
 133 extern size_t   segkmem_kmemlp_max;
 134 
 135 #define SEGKMEM_USE_LARGEPAGES (segkmem_lpsize > PAGESIZE)
 136 
 137 #define IS_KMEM_VA_LARGEPAGE(vaddr)                                     \
 138         (((vaddr) >= heap_lp_base) && ((vaddr) < heap_lp_end))
 139 
 140 extern struct seg_ops segkmem_ops;
 141 
 142 #endif  /* _KERNEL */
 143 
 144 #ifdef  __cplusplus
 145 }
 146 #endif
 147 
 148 #endif  /* _VM_SEG_KMEM_H */
  |