file system performance Flashcards
what is the role of kernel tables
the kernel maintains the caches of recently used inodes
what are the 4 types of caches used and what is their role
per-process open file table: tells us files that are open
system wide open file table
active inode table; recently used inodes
disk resident inodes and data: data in the disk blocks
where are inode values valid and what is the issue with this
only valid within the same file system so we have to remember the inode number and the system it belongs to
which caches are stored in the kernel
system wide open file table
active inode table
write through caches
every write is copied straight onto the physical mediuim but can still read from blocks in memory
what do buffers allow us to do
decouple byte and block reads
cache blocks to reduce disk activity
use read ahead to speed up access: read the next n blocks not just the one requested
how does buffering and block caches improve performance
we can read and write in the memory block rather than the underlying file system
delayed allocation/ allocate on flush
we allow files to grow in memory through the buffer
why do we use file system flush
all buffers need to be regularly synched to the disk even if non removable to protect against system failure and to speed up operations
what does the dirty flag mean
in the cache it means that the entry has a change in it
we remove the flag once we do the write
what does the sync command do on unix
forces the flush
why do we buffer pool
more efficient buffering
what are the three sections in the buffer pool
lru: least recently used
age
empty
lru (bufferpool)
a doubly linked list of all the blocks currently in memory/cache
as blocks are requested then theyre added and if we run out of space we find a block that isnt being used/ not used in a while and remove it then add the requested block
age (bufferpool)
blocks are read ahead and if accessed then they move into the lru
if not accessed within a certain time then its freed
empty (bufferpool)
unused blocks are copied here so we can quickly add data and push to the lru
bufhash list
contains hashed values based on the file and block number which allows us to quickly find the corresponding blocks
returns a pointer and all blocks with the same value are in a chain together