2

我从williamstalling一书中学习,如果我们增加页面大小然后pagefault首先增加,然后当pagesize变成进程大小时pagefault减少,那么它就写在那里。我无法理解为什么页面错误会增加,就像我增加页面大小一样,请任何人解释原因。谢谢你。

4

1 回答 1

3

页面是通过划分逻辑内存形成的固定大小的“块”。如果我们增加页面大小页面数量将减少( consider an example for that matter , if you have to divide a large piece of bread among few people then you have to make sure that pieces are distributed to all now if you cut it into large chunks the number of pieces will not be sufficient enough to feed all people so some will remain hungry)。类似地,如果页面数量减少,CPU 将有很少的地址可以参考,从而增加数量页面错误。现在如果页面大小变成进程的大小,那么页面数几乎与进程数一样多,因此 CPU 将在没有页面错误的情况下引用它。

于 2013-06-14T04:59:09.427 回答