Subject: Re: map user memory in kernel
To: Emmanuel Dreyfus <manu@NetBSD.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 11/05/2005 11:15:16
In message <20051105153200.GB25865@NetBSD.org>, Emmanuel Dreyfus writes:
>On Sat, Nov 05, 2005 at 12:22:45PM +0100, Wolfgang Solfrank wrote:
>> So no need to actually map the page into memory.  Just make a more or
>> less unique address out of the address given (like e.g. use the physical
>> address on machines where physical and virtual address sizes match) and be
>> done with it.
>
>But what if the page where the address is gets paged out? I can't 
>rely on a physical address in that situation.
>

Unless I badly misunderstand the situation, it doesn't matter.  The 
"address" is nothing of the sort.  Think of it as a hash value; any 
process that is sleeping on that hash value will be awakened, but they 
should all check to see that the situation they're really waiting for 
has occurred.  Otherwise, they sleep again.  

To put it more bluntly: the system would still work correctly if every 
process used 0 as its sleep "address".  It wouldn't be very efficient, 
which is why things aren't done that way, but it would still be correct.

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb