Subject: Re: map user memory in kernel
To: Eric Haszlakiewicz <erh@nimenees.com>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 11/05/2005 11:49:48
In message <20051105164552.GA1060@jodi.nimenees.com>, Eric Haszlakiewicz writes
:
>On Sat, Nov 05, 2005 at 11:15:16AM -0500, Steven M. Bellovin wrote:
>> 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.
>
> It _does_ matter if you're using the physical address as the key
>to pass to sleep/wakeup. It wouldn't work correctly if the page got
>paged back in to a different physical address. Then you've called sleep
>with one value and might call wakeup with a different one.
>
That's correct, but only under certain circumstances: if the wakeup
process is recalculating the physical address. In many cases, the
wakeup address is stored in a per-instance data structure.
--Steven M. Bellovin, http://www.cs.columbia.edu/~smb