Date: Tue, 05 Feb 2002 16:27:28 -0500 From: "Brian F. Feldman" <green@FreeBSD.org> 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 Message-ID: <200202052127.g15LRSL61439@green.bikeshed.org> In-Reply-To: Your message of "Tue, 05 Feb 2002 13:23:05 PST." <200202052123.g15LN5f05643@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein <alfred@FreeBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202052127.g15LRSL61439>