summaryrefslogtreecommitdiffstats
path: root/lib/libmemstat/memstat_uma.c
diff options
context:
space:
mode:
authorsbruno <sbruno@FreeBSD.org>2010-06-15 19:28:37 +0000
committersbruno <sbruno@FreeBSD.org>2010-06-15 19:28:37 +0000
commit3571902304966f5edad4bceddc7fb3170f4ff982 (patch)
treec365e722a1674a60a8186f54209e8934369f70a5 /lib/libmemstat/memstat_uma.c
parent597252854841710d6981f293f5bab6880df163b0 (diff)
downloadFreeBSD-src-3571902304966f5edad4bceddc7fb3170f4ff982.zip
FreeBSD-src-3571902304966f5edad4bceddc7fb3170f4ff982.tar.gz
Add a new column to the output of vmstat -z to indicate the number
of times the system was forced to sleep when requesting a new allocation. Expand the debugger hook, db_show_uma, to display these results as well. This has proven to be very useful in out of memory situations when it is not known why systems have become sluggish or fail in odd ways. Reviewed by: rwatson alc Approved by: scottl (mentor) peter Obtained from: Yahoo Inc.
Diffstat (limited to 'lib/libmemstat/memstat_uma.c')
-rw-r--r--lib/libmemstat/memstat_uma.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c
index b24721f..4aae61a 100644
--- a/lib/libmemstat/memstat_uma.c
+++ b/lib/libmemstat/memstat_uma.c
@@ -208,6 +208,7 @@ retry:
mtp->mt_numallocs = uthp->uth_allocs;
mtp->mt_numfrees = uthp->uth_frees;
mtp->mt_failures = uthp->uth_fails;
+ mtp->mt_sleeps = uthp->uth_sleeps;
for (j = 0; j < maxcpus; j++) {
upsp = (struct uma_percpu_stat *)p;
@@ -402,6 +403,7 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
mtp->mt_numallocs = uz.uz_allocs;
mtp->mt_numfrees = uz.uz_frees;
mtp->mt_failures = uz.uz_fails;
+ mtp->mt_sleeps = uz.uz_sleeps;
if (kz.uk_flags & UMA_ZFLAG_INTERNAL)
goto skip_percpu;
for (i = 0; i < mp_maxid + 1; i++) {
OpenPOWER on IntegriCloud