Exam 1 Flashcards
Code Motion
Code motion is when you reduce the frequency that a computation is performed. Especially moving code out of loop
Strength Reduction
Reduction in strength is when you replace a costly operation with a simpler one. Ie, replacing multiplication with addition.
In-Lining
In-lining is an optimization technique that may be used to improve performance when a small function is called from within a high iteration loop
Loop-unrolling
Loop unrolling is when you move code outside of a loop and expand it to minimize the number of instructions that are executed; the performance improvement comes from the fact that fewer instrs are being executed
Superscalar architecture
Can issue and execute multiple instructions in one cycle; they’re retrieved from a sequential instruction stream and are usually scheduled dynamically. Can take advantage of instruction level parallelism
Speculative execution
Speculative execution is an optimization where the system performs a task way ahead of time, that may or may not be needed, in order to prevent a delay from occurring when and if the work is actually needed.
RAS and CAS
Row Address Strobe
Column Address Strobe
Platters
Construct the disk; consist of two sides called surfaces
Surfaces
Make up platters and are coated with magnetic recording material
Cylinders
The collection of tracks on all the surfaces that are equidistant from the center of the spindle
Rotational rate
Measured in RPM; how fast the spindle spins on the platter
Track
Located on surfaces in concentric rings
Sector
How each individual track is partitioned
Recording density
(bits/in) The number of bits that can be squeezed into a 1 inch segment of the track
Track density
(tracks/in) The number of tracks that can be sequeezed into a 1-inch segment of the radius extending from the center of the platter
Areal density
The product of the recording density and the track density
Disk capacity
bytes/sector * average # sectors/track * # tracks/surface * #surfaces/platter * # platters/disk
Seek time
The time required to move the arm over the track that contains the target sector
Rotational latency
Once the head is in position over the track, the amount of time it takes for the first bit of the target sector to pass under the head
Transfer time
1/RPM * 1/average # sector/track * 60 secs/1 min
Cache Block
The data in the cache
Cache line
cache size/block size
Cach Sets
number of lines/lines per set
Cache associativity
of lines per set
Direct-mapped cache
Each main memory address maps to exactly one cache block
Advantages: Simple technique and the mapping scheme is easy to implement.
Disadvantages: Each block of main memory maps to a fixed location in the cache; therefore, if two different blocks map to the same location in cache and they are continually referenced, the two blocks will be continually swapped in and out (known as thrashing)
Fully associative cache
Permits data to be stored in any cache block, instead of forcing each memory address into one particular block.
Advantages: Much better hit rate
Disadvantages: Slower access time
Write-through
Write immediately to memory
Write-allocate
Load into cache, update line in cache
Write-back
Defer write to memory until replacement of line; need a dirty bit
No-write-allocate
Writes straight to memory, does not load into cache
What happens when you increase cache size?
Decrease miss rate, increase hit time
What happens when you increase block size?
decrease miss rate, increase miss penalty
What happens when you increase associativity?
decrease miss rate, increase hit time, increase miss penalty
Trap
The type of exception that occurs intentionally as a result of executing an instruction. Example: User program opens a file
Interrupts
The type of exception that is generated by an I/O device. Example: I/O device completes request
Fault
If a process causes an access to data or instruction that is not currently in main memory. Example: Read of a instruction not currently in main memory
Abort
If a process causes an access to corrupted data or instructions. Example: Hardware error
Concurrent processing
Single processor executes multiple processes concurrently. Register values for nonexecuting process saved in memory
Logical control flow
Each program seems to have exclusive use of the CPU, provided by kernel mechanism called context switching.
Private virtual address space
Each program seems to have exclusive use of main memory. Provided by kernel mechanism called virtual memory
Context switch
Processes are managed by a shared chunk of memory resident OS code called the kernel. Important: the kernel is not a separate process, but rather runs as part of some existing process. Control flow passes from one process to another via a context switch
errno
On error, Linux system-level functions typically return -1 and set global variable errno to indicate cause.
exit()
Terminates with an exit status of status. Convention: normal return status is 0, nonzero on error. Another way to explicitly set the exit status is to return an integer value from the main routine
zombie
When process terminates, it still consumes system resources. Examples: Exit status, various OS tables. Called a “zombie”. Living corpse, half alive and half dead
Rotation time
1/RPM * 60 secs/1 minute
Seek time
60 seconds/RPM