|
Computer Science 322 Operating Systems Mount Holyoke College Spring 2008
|
|
Lecture 30: File System Optimizations: Caching, RAID, Journaling, Disk Scheduling
Date: Monday, April 28, 2008
- Announcements
- Paper drafts Wednesday - the better they are the more
feedback I can give you
- Scheduling presentations: Monday 5/5, time?
- Lecture assignment recap
- File Systems
- More on Unix Inodes
- Free Space Management
- Caching
- disks are slow, we want to use caching to speed up
- caches may be in main memory, disk controller, disk
drive
- many Unix systems use: buffer cache
- this introduces potential inconsistencies, need
consistency checkers like fsck, scandisk
- Log-based/Journaled File Systems
- avoid inconsistencies by writing changes to the
filesystem as atomic transactions
- state of file system is determined by actual file system
on disk and a set of uncommitted transactions
- approach also provides performance benefits
- RAID: a file system spanning multiple disks/partitions
- Redundant Array of Independent/Inexpensive Disks
- store a partition across multiple disks
- improve reliability
- improve efficiency
- convenience
- RAID levels: 0 through 6, 0+1, 1+0
- implementation in software or hardware
- Disk Scheduling Algorithms
- Recall: cost of a disk access includes seek time and
rotational latency
- We wish to minimize seek time by minimizing the distance the
read/write head has to move in order to service the incoming
requests by reordering requests based on cylinder number
- This optimization may be done by the disk, the hardware
controller, or by the operating system
- Compare algorithms by examining their performance on a given
request queue
- First-Come First-Served (FCFS)
- Shortest Seek Time First (SSTF)/Closest Cylinder Next
- SCAN or Elevator Algorithm
- LOOK Algorithm
- Circular Algorithms
- Comparing Disk Scheduling Algorithms
- SSTF or LOOK are often reasonable for a default algorithm
- SCAN and C-SCAN are better for heavily loaded systems
where LOOK is unlikely to save much and SSTF runs the risk of
starvation
- performance depends on the frequency and types of requests
- we may want to consider some of this when we decide
how to organize file systems
- FreeBSD's ufs filesystem uses an elevator algorithm (see
/usr/src/sys/ufs/ufs/ufs_disksubr.c)
Due at the start of class, Wednesday, April 30, 2008.
Turn in short answers to these questions. Please turn in a hard
copy (typeset or handwritten are OK). We will discuss these questions
during class, so no late submissions are accepted.
- Submit a one-page summary of the important ideas behind the Unix
Buffer Cache, based on the supplemental readings.
- SG&G 12.2
The readings for next time are SG&G Chapter 12, UNIX Buffer Cache
handout from Bach 1986.
Journaling filesystems:
RAID: