From owner-cvs-all Tue Feb 5 13:27:36 2002 Delivered-To: cvs-all@freebsd.org Received: from green.bikeshed.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1062537B426; Tue, 5 Feb 2002 13:27:27 -0800 (PST) Received: from localhost (green@localhost) by green.bikeshed.org (8.11.6/8.11.6) with ESMTP id g15LRSL61439; Tue, 5 Feb 2002 16:27:28 -0500 (EST) (envelope-from green@green.bikeshed.org) Message-Id: <200202052127.g15LRSL61439@green.bikeshed.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/vm vm_extern.h vm_glue.c vm_map.c vm_map.h src/sys/kern kern_exit.c In-Reply-To: Your message of "Tue, 05 Feb 2002 13:23:05 PST." <200202052123.g15LN5f05643@freefall.freebsd.org> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Feb 2002 16:27:28 -0500 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Alfred Perlstein wrote: > alfred 2002/02/05 13:23:05 PST > > Modified files: > sys/vm vm_extern.h vm_glue.c vm_map.c vm_map.h > sys/kern kern_exit.c > Log: > Fix a race with free'ing vmspaces at process exit when vmspaces are > shared. > > Also introduce vm_endcopy instead of using pointer tricks when > initializing new vmspaces. > > The race occured because of how the reference was utilized: > test vmspace reference, > possibly block, > decrement reference > > When sharing a vmspace between multiple processes it was possible > for two processes exiting at the same time to test the reference > count, possibly block and neither one free because they wouldn't > see the other's update. > > Submitted by: green For what it's worth, Matt Dillon did propose a possible alternate solution for this problem. I still haven't gotten around to puzzling that one out, so for now the simple solution that costs 4 bytes per vmspace isn't too bad, especially in comparison to the amount of memory leaked by shared memory segments that cannot be freed when a LinuxThreads program crashes. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org <> bfeldman@tislabs.com \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message