67 #include <sys/strlog.h>
68 #include <sys/mman.h>
69 #include <sys/ontrap.h>
70 #include <sys/lgrp.h>
71 #include <sys/vfs.h>
72
73 #include <vm/hat.h>
74 #include <vm/anon.h>
75 #include <vm/page.h>
76 #include <vm/seg.h>
77 #include <vm/pvn.h>
78 #include <vm/seg_kmem.h>
79 #include <vm/vm_dep.h>
80 #include <sys/vm_usage.h>
81 #include <fs/fs_subr.h>
82 #include <sys/ddi.h>
83 #include <sys/modctl.h>
84
85 static pgcnt_t max_page_get; /* max page_get request size in pages */
86 pgcnt_t total_pages = 0; /* total number of pages (used by /proc) */
87
88 /*
89 * freemem_lock protects all freemem variables:
90 * availrmem. Also this lock protects the globals which track the
91 * availrmem changes for accurate kernel footprint calculation.
92 * See below for an explanation of these
93 * globals.
94 */
95 kmutex_t freemem_lock;
96 pgcnt_t availrmem;
97 pgcnt_t availrmem_initial;
98
99 /*
100 * These globals track availrmem changes to get a more accurate
101 * estimate of tke kernel size. Historically pp_kernel is used for
102 * kernel size and is based on availrmem. But availrmem is adjusted for
103 * locked pages in the system not just for kernel locked pages.
104 * These new counters will track the pages locked through segvn and
105 * by explicit user locking.
106 *
|
67 #include <sys/strlog.h>
68 #include <sys/mman.h>
69 #include <sys/ontrap.h>
70 #include <sys/lgrp.h>
71 #include <sys/vfs.h>
72
73 #include <vm/hat.h>
74 #include <vm/anon.h>
75 #include <vm/page.h>
76 #include <vm/seg.h>
77 #include <vm/pvn.h>
78 #include <vm/seg_kmem.h>
79 #include <vm/vm_dep.h>
80 #include <sys/vm_usage.h>
81 #include <fs/fs_subr.h>
82 #include <sys/ddi.h>
83 #include <sys/modctl.h>
84
85 static pgcnt_t max_page_get; /* max page_get request size in pages */
86 pgcnt_t total_pages = 0; /* total number of pages (used by /proc) */
87 uint64_t n_throttle = 0; /* num times page create throttled */
88
89 /*
90 * freemem_lock protects all freemem variables:
91 * availrmem. Also this lock protects the globals which track the
92 * availrmem changes for accurate kernel footprint calculation.
93 * See below for an explanation of these
94 * globals.
95 */
96 kmutex_t freemem_lock;
97 pgcnt_t availrmem;
98 pgcnt_t availrmem_initial;
99
100 /*
101 * These globals track availrmem changes to get a more accurate
102 * estimate of tke kernel size. Historically pp_kernel is used for
103 * kernel size and is based on availrmem. But availrmem is adjusted for
104 * locked pages in the system not just for kernel locked pages.
105 * These new counters will track the pages locked through segvn and
106 * by explicit user locking.
107 *
|