From owner-freebsd-hackers Wed Nov 20 18: 7:17 2002 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 9930037B401 for ; Wed, 20 Nov 2002 18:07:16 -0800 (PST) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id D764F43E42 for ; Wed, 20 Nov 2002 18:07:15 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id gAL27Em9002172; Wed, 20 Nov 2002 18:07:14 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id gAL27EQE002171; Wed, 20 Nov 2002 18:07:14 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Wed, 20 Nov 2002 18:07:14 -0800 From: David Schultz To: Mike Silbersack Cc: Tony Finch , hackers@FreeBSD.ORG Subject: Re: cvs commit: src/bin/sleep sleep.c Message-ID: <20021121020714.GB2107@HAL9000.homeunix.com> Mail-Followup-To: Mike Silbersack , Tony Finch , hackers@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Mike Silbersack : > I'm curious how well COW sharing really works under FreeBSD. Earlier this > year, I fixed a piece of code which was O((processes sharing a page)^2) in > the VM system. When certain simple forkbombs were run, they would cause > the machine to freeze for 30 seconds at a time or more once the VM cleanup > routines kicked in and ran the O(N^2) piece of code. > > What bugged me at the time was that I couldn't seem to reproduce the > problem with other programs... this led me to believe that we aren't > really sharing too many pages in common use, but I didn't have time to > investigate if that was true or not. Someone with an interest in VM > implementations might want to take a wander through and see how well page > sharing really works on a typical FreeBSD system. :) I'm not sure exactly what routine you're referring to, but one thing to keep in mind is that most pages that somehow got to be massively shared are never, ever written. For example, the text segment of virtually all executables is read-only, except when using debuggers. Anyway, the point is that if it takes O(N^2) time to take a write fault on a page shared by N processes, that's certainly bad, but not as bad as it sounds. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message