Linux: Page faults and the Network File System

Linux: Page faults and the Network File System … here is a solution to the problem.

Linux: Page faults and the Network File System

If a Linux system runs out of physical memory, does it discard inactive pages of executable code? I think the answer is yes, since there is no reason to keep them swapped, so they are simply discarded and reloaded if necessary (as far as I know, this is what FreeBSD does).

If the above applies to Linux, my question is, how does it handle executables run from a network file system such as NFS? If there is a page fault, does it fetch the executable page over the network?

Solution

If a Linux system runs out of physical
memory, does it drop inactive
executable code pages? I assume the
answer is yes, since there is no
reason to keep them in swap, so they
are simply discarded and re-loaded if
necessary (as far as I know, that’s
what FreeBSD does).

Yes.

If the above is true for Linux, my
question is, how does it handle
executables run from network
filesystems (e.g. NFS)? Does it go and
fetch executable pages over the
network if there is a page fault?

Client for NFS caches content locally (if you’re concerned about speed), but probably probably the entire file (if you’re concerned about consistency). This is a related NFS FAQ entry

Related Problems and Solutions