系统相关
首页 > 系统相关> > Linux:页面错误和网络文件系统

Linux:页面错误和网络文件系统

作者:互联网

如果Linux系统的物理内存不足,它会丢弃不活动的可执行代码页吗?我认为答案是肯定的,因为没有理由让它们保持交换状态,因此只要有必要,就将它们丢弃并重新装入(据我所知,这就是FreeBSD所做的).

如果以上情况适用于Linux,我的问题是,它如何处理从网络文件系统(例如NFS)运行的可执行文件?如果出现页面错误,是否可以通过网络获取可执行页面?

解决方法:

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).

是的,它确实.

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?

NFS客户端在本地缓存内容(如果您担心速度),但可能不会缓存整个文件(如果您担心一致性).这是相关的NFS FAQ entry.

标签:virtual-memory,linux
来源: https://codeday.me/bug/20191106/1999458.html