Date: Thu, 23 Jan 2020 04:56:34 +0000 (UTC) From: Ryan Libby <rlibby@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357018 - head/sys/vm Message-ID: <202001230456.00N4uYSm060263@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rlibby Date: Thu Jan 23 04:56:34 2020 New Revision: 357018 URL: https://svnweb.freebsd.org/changeset/base/357018 Log: uma: report leaks more accurately Previously UMA had some false negatives in the leak report at keg destruction time, where it only reported leaks if there were free items in the slab layer (rather than allocated items), which notably would not be true for single-item slabs (large items). Now, report a leak if there are any allocated pages, and calculate and report the number of allocated items rather than free items. Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23275 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jan 23 04:54:49 2020 (r357017) +++ head/sys/vm/uma_core.c Thu Jan 23 04:56:34 2020 (r357018) @@ -2440,11 +2440,11 @@ keg_dtor(void *arg, int size, void *udata) pages += keg->uk_domain[i].ud_pages; KEG_LOCK_FINI(keg, i); } - if (free != 0) + if (pages != 0) printf("Freed UMA keg (%s) was not empty (%u items). " " Lost %u pages of memory.\n", keg->uk_name ? keg->uk_name : "", - free, pages); + pages / keg->uk_ppera * keg->uk_ipers - free, pages); hash_free(&keg->uk_hash); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001230456.00N4uYSm060263>