[mythtv-users] how to keep executables resident?

Kyle Rose krose+mythtv at krose.org
Wed Jan 21 11:58:23 EST 2004


"Joseph A. Caputo" <jcaputo1 at comcast.net> writes:

> On Wednesday 21 January 2004 02:37, David Jeske wrote:
>> buffers expand and push out non-active code pages. Even if I turn off
>> swap, executables seem to get pushed out and demand loaded back from
>> the executable.
...
> Get lots of memory and turn off your swap partition :-)

You wanna read that again? :)

Linux executables are demand-paged from their original inode, which
means they aren't paged out to swap when memory runs low, but are
instead evicted from memory and then re-read from the original
location on disk.  (This is why one cannot cp over a running
demand-paged executable in Linux: cp opens for rw, truncs the file,
and then writes from position 0, instead of writing a temporary file
and renaming it over the original, as one would initially expect.
Linux won't allow running demand-paged executables to be edited.)
Therefore, even without swap, he will still get this behavior.  This
is why I recommended mlockall(), which will trapdoor all the code
pages in memory for the lifetime of the execution.

Cheers,
Kyle


More information about the mythtv-users mailing list