From bec2d7e9a286525cd2349cb11e35010021681045 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 29 May 2019 03:14:46 +0000 Subject: The KVM code also needs a fix similar to r344269. Reported by: pho --- lib/libmemstat/memstat_uma.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/libmemstat') diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c index 89b394c151ad..2575fb704521 100644 --- a/lib/libmemstat/memstat_uma.c +++ b/lib/libmemstat/memstat_uma.c @@ -423,6 +423,11 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle) mtp->mt_failures = kvm_counter_u64_fetch(kvm, (unsigned long )uz.uz_fails); mtp->mt_sleeps = uz.uz_sleeps; + + /* See comment above in memstat_sysctl_uma(). */ + if (mtp->mt_numallocs < mtp->mt_numfrees) + mtp->mt_numallocs = mtp->mt_numfrees; + if (kz.uk_flags & UMA_ZFLAG_INTERNAL) goto skip_percpu; for (i = 0; i < mp_maxid + 1; i++) { -- cgit v1.2.3