From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 26 18:30:08 2005 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A78C016A420; Wed, 26 Oct 2005 18:30:08 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3775C43D46; Wed, 26 Oct 2005 18:30:08 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.3/8.13.1) with ESMTP id j9QISFXX052429; Wed, 26 Oct 2005 14:28:15 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.3/8.13.1/Submit) id j9QISEgg052428; Wed, 26 Oct 2005 14:28:14 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 26 Oct 2005 14:28:14 -0400 From: David Schultz To: nocool Message-ID: <20051026182814.GA52373@VARK.MIT.EDU> Mail-Followup-To: nocool , freebsd-hackers , freebsd-current , delphij References: <20051024134527.31E53F02@smtp.263.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051024134527.31E53F02@smtp.263.net> Cc: freebsd-hackers , freebsd-current , delphij Subject: Re: Re: where to release proc.p_stats X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2005 18:30:08 -0000 On Mon, Oct 24, 2005, nocool wrote: > Can memory management system utilize COW to supply zero-filled page to kernel or user process. > That is to say: > When processes want zeroed page, we give them a mirror of one already zerod pages. If they just > read, they can read zero from the back page. > We needn't really alloc a new zero-filled page until they modify the page. > So we can saving many time from filling pages with zero, if some process just want read from them. I don't know whether this is done now, but yes, we could do copy-on-write (really, allocate-on-write) for heap pages that have never been written to. But this is a sort of silly optimization that would only affect naive benchmarks. The value stored at a location on the heap that has never been written to is unspecified, so correct applications would never notice this change. Incorrect applications might use fewer pages, but they could also take more traps (one for the read and one for the write), so this change might actually reduce performance.