Date: Thu, 28 Jul 2005 00:34:56 +0100 (BST) From: Robert Watson <rwatson@FreeBSD.org> To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_malloc.c Message-ID: <20050728003334.V54330@fledge.watson.org> In-Reply-To: <200507272317.j6RNHVHb086993@repoman.freebsd.org> References: <200507272317.j6RNHVHb086993@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 27 Jul 2005, Pawel Jakub Dawidek wrote: > Fix the way how "InUse" column in 'vmstat -m' output works: > - increase number of allocations count only on successfull malloc(9), > so it doesn't confuse people; > - because we need to check if 'size > 0', hide 'mtsp->mts_memalloced += size;' > under the check as well, as for size=0 it is of course a no-op; > - avoid critical_enter()/critical_exit() in case of failure in > malloc_type_allocated() as there will be nothing to do. I think it would be quite useful to track malloc failures by type, not just successes; libmemstat(3) incudes a memstat_get_failures() call to retrieve failure statistics if they are supported by the underlying allocator. Adding a per-cpu failure account should be straight forward; also, I wouldn't worry to much about the cost of the critical enter/exit in the failure case, as optimizing for failures in malloc(9) will have little impact on system performance (especially since the removal of administrative limits on malloc types). Robert N M Watson
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050728003334.V54330>