Subject: Re: uvm_vslock / uvm_vsunlock problems
To: David Laight <david@l8s.co.uk>
From: Stephan Uphoff <ups@stups.com>
List: tech-kern
Date: 07/11/2003 16:54:58
David Laight wrote:
> sysctl kern.proc has the process table write lock held, so must not block.
> 
> It is possible to enumerate the process table without disabling pre-emption
> (which is why sysctl for ps has to lock down the user memory).
> You would (probably) want to block fork and exit in order to get a
> consistent view [1].
> [...]
> [1] otherwise a process could 'hide' by calling 'if (fork() > 0) exit(0);'
> in a loop.


I like the enumeration approach.
However I would dislike blocking fork and exit.
Maybe we can enumerate by using a dummy proc object as
a place holder in the allproc list.
Enumerating the list backwards should prevent [1].
Not exactly a snapshot of the process table - but should be good 
enough.


	Stephan