

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


111 Cheat Sheet
platform
platform that supports that API
Instruction Set Architecture.
structure,
that ABI.
assembly language subroutines.
interface is a subset of ABI.
【 Linkage editing 】
infers the intended computations, for which it will generate lower level code (assembly code).
data
offsets
loaded modules (by linkage editor, ld(1))
and noting where (in that virtual address space) each was placed.
places them in the evolving virtual address space as well.
the instructions and initialized data values from the load module into that virtual address space.
【 Modules 】
(ISA) specific.
¨ header section
¨ Code and Data section
¨ symbol table (for external)
¨ A collection of relocation entries
read/execute only and sharable
private, grow/shrink by program(sbrk)
【 Library 】
segment
read-only) code segments, and map into address space. (in ld.so(8))
a problem.
implemented.
through a table or vector of entry points
initialization and support complex (bi-directional) calls between the client application and library.
service entry points.
【 Traps and Interrupts 】
Status. Switch to supervisor mode.
exception occurs. It will contain pointers to exception handling routines, indexed by a number
specifying the particular exception that occurs. It is consulted whenever an exception actually
occurs. It is loaded at boot time and typically will not change until the next reboot.
'return', (privileged) reload PC/PS, and resumes execution at the interruption in user mode.
【 Scheduling 】
¨ Convoy effect: 一个顾客占时太久,耽误大量小顾客。
¨ Optimal in theory. 但是如果小顾客稍微来晚点就也要等很久。
¨ Non-preemptive. FIFO, SJF, RR,
¨ it can preempt job A and decide to run another job, perhaps continuing A later.
(scheduling quantum) and then switches to the next job in the run queue.
¨ amortize(分摊) the cost, but TOO MUCH context switches
Multi-Level Feedback Queue
complete. Don't penalize it.
system to the topmost queue
up the CPU), its priority is reduced (i.e., it moves down one queue).
【 Segmentation 】
memory. (code, heap, stack)
out of bounds, traps into the OS.
save base and bounds registers in process control block (PCB))
base&bound pair, and plus the offset.
(unused) space in such a chunk.
the caller; the second chunk will remain on the list.
as well as the nearby chunks of free space; if the newly- freed space sits right next to one (or two, as in this
example) existing free chunks, merge them into a single larger free chunk.
据 frequency 变更 slabs 大小
【 Paging 】
space more flexibly. Internal frag: average only 1/2 page (of the last one).
page has been modified since it was brought into memory), reference bit( whether a page has been
accessed, popular or not), user/supervisor bit (U/S)
page table base register) and looks up the page table entry (PTE) for this page using the VPN as
an index. If the page is valid and present in physical memory, the hardware extracts the PFN from
the PTE, installs it in the TLB, and retries the instruction - > TLB hit
comes to new page, it will have a new TLB miss.
¨ 方法 1 flush the TLB。清空
¨ 方法 2 address space identifier (ASID), ≈ PID.
【 Physical Memory 】
request to disk to fetch the page into memory
physical memory; 3. page fault, replace page in physical memory with page in disk.
here.
which). When a replacement must occur, the OS checks if the currently-pointed to page P has a use
bit of 1 or 0. If 1, this implies that page P was recently used and thus is not a good candidate for
replacement. Thus, the use bit for P set to 0 (cleared), and the clock hand is incremented to the next
page (P +1). The algorithm continues until it finds a use bit that is set to 0, implying this page has not
been recently used.
clean pages over dirty pages. 因为 evict 不用重新 write to disk. we can do background write-out of dirty
pages (by turning dirty pages into clean pages) to further reduce I/O involved in their eviction.
view physical memory as an array of fixed-sized slots called page frames; each of these frames can
contain a single virtual-memory page.
【 Garbage Collection 】
用自动删;记录 allocation/release 太多太费时。
所有还在 list 上的
【 Defragmentation 】
的地方,再删这块并加入 free list
【Working Set】
run all of the ready processes。内存变少,Page fault 变多。
maximize throughput(efficiency).
referenced;如果没有,则算它的 age,如果大于 target age 则 return(否则小于就换算是 thrashing)。
child), and otherwise two process refer to the same physical memory
heap to the same physical address, and no copies are made, which reduces the overhead
current static data) with it; the heap and stack and other parts of the memory space of the program
are re-initialized.
treated uniformly.-> interface + plugging in implementations + optional features
support high layer..), but add performance penalties(change data structures when change layer) and
limit what upper layer do.
managed by OS itself(not by user code, must ask OS to access or alter)
process’ own OS resources(open files, current working directory, locks), OS-related state info
process(pid. state to restore, references to allocated resources, info to support process operations),
managed by OS. PD example: linux process control block.
however, at certain key points in time (such as when a process issues a system call, or a timer
interrupt occurs), arrange so that the OS gets involved and makes sure the “right” thing happens.
Key to good system performance!