1/*-
2 * Copyright (c) 2005-2006 Robert N. M. Watson
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
--- 9 unchanged lines hidden (view full) ---
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/lib/libmemstat/memstat_uma.c 261726 2014-02-10 20:09:10Z glebius $
27 */
28
29#include <sys/param.h>
30#include <sys/cpuset.h>
31#include <sys/sysctl.h>
32
33#include <vm/vm.h>
34#include <vm/vm_page.h>
--- 172 unchanged lines hidden (view full) ---
207 mtp->mt_percpu_cache[j].mtp_free =
208 upsp->ups_cache_free;
209 mtp->mt_free += upsp->ups_cache_free;
210 mtp->mt_numallocs += upsp->ups_allocs;
211 mtp->mt_numfrees += upsp->ups_frees;
212 }
213
214 mtp->mt_size = uthp->uth_size;
215 mtp->mt_rsize = uthp->uth_rsize;
216 mtp->mt_memalloced = mtp->mt_numallocs * uthp->uth_size;
217 mtp->mt_memfreed = mtp->mt_numfrees * uthp->uth_size;
218 mtp->mt_bytes = mtp->mt_memalloced - mtp->mt_memfreed;
219 mtp->mt_countlimit = uthp->uth_limit;
220 mtp->mt_byteslimit = uthp->uth_limit * uthp->uth_size;
221
222 mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees;
223 mtp->mt_zonefree = uthp->uth_zone_free;
--- 207 unchanged lines hidden (view full) ---
431 list->mtl_error = ret;
432 return (-1);
433 }
434 mtp->mt_free += ub.ub_cnt;
435 }
436 }
437skip_percpu:
438 mtp->mt_size = kz.uk_size;
439 mtp->mt_rsize = kz.uk_rsize;
440 mtp->mt_memalloced = mtp->mt_numallocs * mtp->mt_size;
441 mtp->mt_memfreed = mtp->mt_numfrees * mtp->mt_size;
442 mtp->mt_bytes = mtp->mt_memalloced - mtp->mt_memfreed;
443 if (kz.uk_ppera > 1)
444 mtp->mt_countlimit = kz.uk_maxpages /
445 kz.uk_ipers;
446 else
447 mtp->mt_countlimit = kz.uk_maxpages *
--- 19 unchanged lines hidden ---
2 * Copyright (c) 2005-2006 Robert N. M. Watson
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
--- 9 unchanged lines hidden (view full) ---
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/lib/libmemstat/memstat_uma.c 261726 2014-02-10 20:09:10Z glebius $
27 */
28
29#include <sys/param.h>
30#include <sys/cpuset.h>
31#include <sys/sysctl.h>
32
33#include <vm/vm.h>
34#include <vm/vm_page.h>
--- 172 unchanged lines hidden (view full) ---
207 mtp->mt_percpu_cache[j].mtp_free =
208 upsp->ups_cache_free;
209 mtp->mt_free += upsp->ups_cache_free;
210 mtp->mt_numallocs += upsp->ups_allocs;
211 mtp->mt_numfrees += upsp->ups_frees;
212 }
213
214 mtp->mt_size = uthp->uth_size;
215 mtp->mt_rsize = uthp->uth_rsize;
216 mtp->mt_memalloced = mtp->mt_numallocs * uthp->uth_size;
217 mtp->mt_memfreed = mtp->mt_numfrees * uthp->uth_size;
218 mtp->mt_bytes = mtp->mt_memalloced - mtp->mt_memfreed;
219 mtp->mt_countlimit = uthp->uth_limit;
220 mtp->mt_byteslimit = uthp->uth_limit * uthp->uth_size;
221
222 mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees;
223 mtp->mt_zonefree = uthp->uth_zone_free;
--- 207 unchanged lines hidden (view full) ---
431 list->mtl_error = ret;
432 return (-1);
433 }
434 mtp->mt_free += ub.ub_cnt;
435 }
436 }
437skip_percpu:
438 mtp->mt_size = kz.uk_size;
439 mtp->mt_rsize = kz.uk_rsize;
440 mtp->mt_memalloced = mtp->mt_numallocs * mtp->mt_size;
441 mtp->mt_memfreed = mtp->mt_numfrees * mtp->mt_size;
442 mtp->mt_bytes = mtp->mt_memalloced - mtp->mt_memfreed;
443 if (kz.uk_ppera > 1)
444 mtp->mt_countlimit = kz.uk_maxpages /
445 kz.uk_ipers;
446 else
447 mtp->mt_countlimit = kz.uk_maxpages *
--- 19 unchanged lines hidden ---