我使用文件映射来读取一个20GB的文件。当主存储器用尽时,内核如何将文件映射的页面交换到磁盘上?
我猜可能的方式是将页面条目设置为NULL。那么下一次访问页面时,将再次调用“do_no_page()”函数将文件映射到内存。是这样吗?
另一个问题是内核用于交换内存页面的优先级是什么?正常的页面还是映射文件的页面?
我使用文件映射来读取一个20GB的文件。当主存储器用尽时,内核如何将文件映射的页面交换到磁盘上?
我猜可能的方式是将页面条目设置为NULL。那么下一次访问页面时,将再次调用“do_no_page()”函数将文件映射到内存。是这样吗?
另一个问题是内核用于交换内存页面的优先级是什么?正常的页面还是映射文件的页面?
页面表中每个条目都有一个无效
位。当页面交换到硬盘时,其无效
位被设置。每当访问页面时,MMU(处理器内存管理单元)会引发异常,系统负责重新将页面加载到内存中。然后重新执行有故障的指令。
Usually pages that are swapped are the pages that are not frequently accessed. There is another bit in each page table entry to know whenever a page has been accessed. How to choose the right page to swap with this single bit is a big problem, there is a whole chapter about this in the very good operating systems by Andrew Tanenbaum.
你可以使用mlock()
系统调用将页面锁定到RAM内存中。如果你使用mmap()
在内存中映射文件,可以使用MAP_LOCKED标志来完成(参见手册)。
For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...
How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks
i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...
Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...
I ve just installed Zend Studio 7.0.2 on my Linux-Ubuntu 9.10 system. There were no problems during the installation but when I try to create a new project, the New Project form hangs when I click ...
I am running valgrind as follows:- /usr/local/bin/valgrind "process_name" After excecution its giving me following error ==21731== ==21731== Warning: Can t execute setuid/setgid executable: ==...
I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...
Is there anything other than DDD that will draw diagrams of my data structures like DDD does that runs on Linux? ddd is okay and runs, just kind of has an old klunky feeling to it, just wanted to ...