[coyotos-dev] Voluntary Pageout
Constantine Plotnikov
cap at isg.axmor.com
Sat Jan 14 16:37:15 EST 2006
Jonathan S. Shapiro wrote:
>On Sat, 2006-01-14 at 17:50 +0600, Constantine Plotnikov wrote:
>
>
>>Described variant of media player is possible, but media
>>players usually do not work this way precisely for the
>>specified reason. So the media player use case does not
>>justify this functionality. While other applications might
>>need such functionality, I could not conceive such application
>>right now. ...
>>
>>
>
>I'm afraid that there has been confusion.
>
>Internally, more and more implementations of libc (including hurd's)
>attempt to implement I/O via memory mapping. They may map a moving
>window on the file, but they do use mapping. In EROS/Coyotos, *all* file
>I/O is ultimately handled by mapping *somewhere*.
>
>So: another way to look at this is that it is a mechanism that can be
>used inside stdio so that the read() or write() routines can indicate
>that the current stream position has passed a given frame and keeping
>the frame in memory is no longer a priority.
>
>
>
I guess I get it now. But I still do not see why invalidating is better
than plain unmapping or remapping.
If frame is not needed, why not just unmap it or remap to some other
sector (in that case libc considers mapped frames as cyclic buffer). If
frame is unmapped, other components of the process will be able to use
it. If the completely read frame is remapped to next unmapped sector of
the file on the disk, the page might be already loaded when cursor
reaches it (provided that the storage driver works asynchonously).
Constantine
More information about the coyotos-dev
mailing list