From owner-cvs-src@FreeBSD.ORG Sun Sep 19 18:35:32 2004 Return-Path: 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 E336F16A4CE; Sun, 19 Sep 2004 18:35:32 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9424B43D1D; Sun, 19 Sep 2004 18:35:32 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id i8JIZWs1000819; Sun, 19 Sep 2004 14:35:32 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id i8JIZWtB000818; Sun, 19 Sep 2004 14:35:32 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sun, 19 Sep 2004 14:35:32 -0400 From: David Schultz To: src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG Message-ID: <20040919183532.GA791@VARK.MIT.EDU> Mail-Followup-To: src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200409191834.i8JIYHXU089517@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200409191834.i8JIYHXU089517@repoman.freebsd.org> Subject: Re: cvs commit: src/sys/kern kern_proc.c kern_switch.c src/sys/sys sched.h src/sys/vm vm_glue.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 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: Sun, 19 Sep 2004 18:35:33 -0000 On Sun, Sep 19, 2004, David Schultz wrote: > das 2004-09-19 18:34:17 UTC > > FreeBSD src repository > > Modified files: > sys/kern kern_proc.c kern_switch.c > sys/sys sched.h > sys/vm vm_glue.c > Log: > The zone from which proc structures are allocated is marked > UMA_ZONE_NOFREE to guarantee type stability, so proc_fini() should > never be called. Move an assertion from proc_fini() to proc_dtor() > and garbage-collect the rest of the unreachable code. I have retained > vm_proc_dispose(), since I consider its disuse a bug. In the same vein, the zones for vmspaces and vm_maps also have unused fini() routines. But I intend to leave those to someone else, since I don't know why those zones are labeled UMA_ZONE_NOFREE in the first place. On a related note, I think it would be a good idea to repurpose the fini() callback for UMA_ZONE_NOFREE zones as a low-memory callback. That is, fini() would be called from zone_drain() at most once on free objects, even though the objects themselves would not be reclaimed. This would give us a mechanism to free UAREAs for free proc structures lazily. This would avoid the overhead of an unmap operation in the common case where the proc structure is immediately reused, but it wouldn't tie up a bunch of real memory needlessly if there are many free proc structures floating around. Unfortunately, the above may not be as easy to implement in UMA as it would for a magazine allocator. (You'd need an auxiliary data structure to keep track of which objects within a partially free slab have already been fini'd.) Moreover, saving one page of real memory per long-unused proc structure may not be worth the trouble.