TLB未命中——为何你的leetcode程序时快时慢
TLB未命中——为何你的leetcode程序时快时慢
Paging: Introduction
It is sometimes said that the operating system takes one of two approaches when solving most any space-management problem. The first approach is to chop things up into variable-sized pieces, as we saw with segmentation in virtual memory. Unfortunately, this solution has inherent difficulties. In particular, when dividing a space into different-size chunks, the space itself can become fragmented, and thus allocation becomes more challenging over time.
Thus, it may be worth considering the second approach: to chop up space into fixed-sized pieces. In virtual memory, we call this idea paging, and it goes back to an early and important system, the Atlas [KE+62, L78]. Instead of splitting up a process’s address space into some number of variable-sized logical segments (e.g., code, heap, stack), we divide it into fixed-sized units, each of which we call a page. Correspondingly, we view physical memory as an array of fixed-sized slots called page frames; each of these frames can contain a single virtual-memory page. Our challenge:
THE CRUX:
HOW TO VIRTUALIZE MEMORY WITH PAGES
How can we virtualize memory with pages, so as to avoid the problems of segmentation? What are the basic techniques? How do we make those techniques work well, with minimal space and time overheads?
类似虚拟内存管理中的分段(segmantation)的variable-sized的分片,随着时间推移碎片化(fragmented),内存分配会变得越来越困难。
因此,我们将进程的地址空间分割为fixed-sized的单元,每个单元称为页(page)。对应地我们将虚拟内存看作fixed-sized槽块的数组,称之为页帧s,每个这样的帧可以包括一个单独的虚拟内存页。
ChangeLog
- 04.07 17:09 未完待续~