From owner-cvs-src@FreeBSD.ORG Wed Jul 27 23:33:33 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2BCDF16A41F; Wed, 27 Jul 2005 23:33:33 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [204.156.12.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB45743D46; Wed, 27 Jul 2005 23:33:32 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by cyrus.watson.org (Postfix) with ESMTP id 16E4646B09; Wed, 27 Jul 2005 19:33:32 -0400 (EDT) Date: Thu, 28 Jul 2005 00:34:56 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Pawel Jakub Dawidek In-Reply-To: <200507272317.j6RNHVHb086993@repoman.freebsd.org> Message-ID: <20050728003334.V54330@fledge.watson.org> References: <200507272317.j6RNHVHb086993@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_malloc.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2005 23:33:33 -0000 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