Date: Tue, 10 Nov 2020 18:12:09 +0000 (UTC) From: "Jonathan T. Looney" <jtl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367573 - head/sys/vm Message-ID: <202011101812.0AAIC9WO022068@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jtl Date: Tue Nov 10 18:12:09 2020 New Revision: 367573 URL: https://svnweb.freebsd.org/changeset/base/367573 Log: When destroying a UMA zone which has a reserve (set with uma_zone_reserve()), messages like the following appear on the console: "Freed UMA keg (Test zone) was not empty (0 items). Lost 528 pages of memory." When keg_drain_domain() is draining the zone, it tries to keep the number of items specified in the reservation. However, when we are destroying the UMA zone, we do not need to keep those items. Therefore, when destroying a non-secondary and non-cache zone, we should reset the keg reservation to 0 prior to draining the zone. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27129 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 10 18:10:50 2020 (r367572) +++ head/sys/vm/uma_core.c Tue Nov 10 18:12:09 2020 (r367573) @@ -2791,6 +2791,10 @@ zone_dtor(void *arg, int size, void *udata) rw_wlock(&uma_rwlock); LIST_REMOVE(zone, uz_link); rw_wunlock(&uma_rwlock); + if ((zone->uz_flags & (UMA_ZONE_SECONDARY | UMA_ZFLAG_CACHE)) == 0) { + keg = zone->uz_keg; + keg->uk_reserve = 0; + } zone_reclaim(zone, M_WAITOK, true); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011101812.0AAIC9WO022068>