Operating System: Three Easy Pieces --- Paging: TLB (Note)

Using paging as the core mechanism to support virtual memeory can lead to high performance

overheads. By chopping the address space into small, fixed-sized units (pages), paging requires

a large amount of mapping information. Because that mapping information is generally stored in

physical memory, paging logically requires an extra memory lookup for each virtual address generated

by program. Going to memory for translation information before every instruction fetch or explicit

load or store is prohibitively slow. And thus our problem: How to speed up address translation?

when we want to make things fast, the OS usually needs some help. And help often comes from the

OS‘s old friend: the Hardware. To speed address translation, we are going to add what is called a

translation-lookaside buffer, or TLB. A TLB is a part of the chip‘s memory-management unit (MMU),

and is simply a hardware cache of popular virtual-to-physical address translations; thus a better name

would be an address-translation cache. Upon each virtual memory reference, the hardware first

checks the TLB to see if the desired translation is held therein; if so, the translation is performed

quickly withour having to consult the page table which has all translations. Because of their tremendous

performance impact, TLBs in a real sense make virtual memeory possible.

时间: 2024-11-15 22:15:53

Operating System: Three Easy Pieces --- Paging: TLB (Note)的相关文章

Operating System: Three Easy Pieces --- Page Fault (Note)

Recall that with TLB misses, we have two types of systems: Hardware managed TLBs (where the hardware looks in the page table to find the desired translation) and software managed TLBs ( where the OS does). In either type of systems, if a page is not

Operating System: Three Easy Pieces --- Thread API (Note)

This chapter briefly covers the main properties of the thread API. Each part will be explained further in the subsequent chapters, as we know how to use the API. More details can be found in various books and online sources. We should note that the s

Operating System: Three Easy Pieces --- Page Replacement (Note)

Thus far, the way we have described how replacements occur assumes that the OS waits until memory is entirely full, and only then replaces or evicts a page to make room for some other pages. As you can imagine, this is a little bit unrealistic, and t

Operating System: Three Easy Pieces --- Pthread Locks (Note)

The name that the POSIX library uses for a lock is a mutex, as it is used to provide mutual exclusion between threads, i.e., if one thread is in the critical section, it excludes the others from entering until it has completed the section. Thus, when

Operating System: Three Easy Pieces --- Mechanism: Limited Direct Execution (Note)

In order to virtualize the CPU, the operating system needs to somehow share the physical CPU among many jobs  running seemingly at the same time. The basic idea is simple: run one process for a little while, then run another, and so forth. By time sh

Operating System: Three Easy Pieces --- Process (Note)

1. How can the operating system provide the illusion of a nearly-endless supply of said CPUs? The OS creates this illusion by virtualizing the CPU. The basic technique, known as the time- sharing the CPU, allows users to run as many concurrent proces

Operating System: Three Easy Pieces --- Locks: Pthread Locks (Note)

The name that the POSIX library uses for a lock is mutex, as it is used to provide mutual exclusion between threads, i.e., if one thread is in the critical sections, it excludes the others from entering until it has completed the section. Thus, when

Operating System: Three Easy Pieces --- Limited Directed Execution (Note)

In order to virtualize the CPU, the operating system needs to somehow share the physical CPU among many jobs running seemingly at the same time. The basic idea is simple: run one process for a little while, then run another one, and so forth. By time

Operating System: Three Easy Pieces --- Beyond Physical Memory: Mechanisms (Note)

Thus far, we have assumed that an address space is unrealistically small and fits into the physical memory. In fact, we have been assuming that every address space of ervery running process fits into memory. We will now relax these big assumptions, a