OSY Q.2 Starvation and RAID Levels Answers
OSY Q.2 Starvation and RAID Levels Answers
Ans.
Starvation:
1. Aging:
Aging is a common method where the priority of a process increases the longer it waits.
This ensures that even low-priority processes eventually receive high enough priority to get
scheduled.
Algorithms like Round Robin ensure every process gets a turn with the CPU, thus avoiding
starvation.
Fair-Share Scheduling allocates resources based on the fair distribution rather than fixed
priority.
Banker’s Algorithm and similar techniques help manage resources in a way that avoids
long waits and starvation.
Some starvation cases are linked to deadlock scenarios, where deadlock prevention
methods (e.g., preventing circular wait) can also help avoid starvation.
3. Explain various RAID LEVELS with its advantages and disadvantages.
Ans.
RAID 0: Striping
RAID 0, also known as a striped set or a striped volume, requires a minimum of two disks.
The disks are merged into a single large volume where data is stored evenly across the
number of disks in the array.
This process is called disk striping and involves splitting data into blocks and writing it
simultaneously/sequentially on multiple disks. Configuring the striped disks as a single
partition increases performance since multiple disks do reading and writing operations
simultaneously. Therefore, RAID 0 is generally implemented to improve speed and
efficiency.
Advantages of RAID 0
RAID 1: Mirroring
RAID 1 is an array consisting of at least two disks where the same data is stored on
each to ensure redundancy. The most common use of RAID 1 is setting up a mirrored
pair consisting of two disks in which the contents of the first disk is mirrored in the
second. This is why such a configuration is also called mirroring.
Unlike with RAID 0, where the focus is solely on speed and performance, the primary
goal of RAID 1 is to provide redundancy. It eliminates the possibility of data loss and
downtime by replacing a failed drive with its replica.
Advantages of RAID 1
Disadvantages of RAID 1
• Uses only half of the storage capacity.
• More expensive (needs twice as many drivers).
• Requires powering down your computer to replace failed drive.
Instead of data blocks, RAID 2 stripes data at the bit level across multiple disks.
Additionally, it uses the Humming error ode correction (ECC) and stores this information
on the redundancy disk.
Advantages of RAID 2
• Reliability.
• The ability to correct stored information.
Disadvantages of RAID 2
• Expensive.
• Difficult to implement.
• Require entire disks for ECC.
To allow synchronized spinning, RAID 3 also needs a special controller. Due to its
configuration and synchronized disk spinning, it achieves better performance rates with
sequential operations than random read/write operations.
Advantages of RAID 3
The implementation requires at least three disks – two for storing data strips and one
dedicated for storing parity and providing redundancy. As each disk is independent and
there is no synchronized spinning, there is no need for a controller.
RAID 4 configuration is prone to bottlenecks when storing parity bits for each data block
on a single drive. Such system bottlenecks have a large impact on system performance.
Advantages of RAID 4
Disadvantages of RAID 4
• Bottlenecks that have big effect on overall performance.
• Slow write operations.
• Redundancy is lost if the parity disk fails.
This RAID level consists of at least three hard drives (and at most, 16). Data is divided
into data strips and distributed across different disks in the array. This allows for high
performance rates due to fast read data transactions which can be done
simultaneously by different drives in the array.
Parity bits are distributed evenly on all disks after each sequence of data has been
saved. This feature ensures that you still have access to the data from parity bits in
case of a failed drive. Therefore, RAID 5 provides redundancy through parity bits instead
of mirroring.
Advantages of RAID 5
Disadvantages of RAID 5
This setup requires a minimum of four drives. The setup resembles RAID 5 but includes
two additional parity blocks distributed across the disk. Therefore, it uses block-level
striping to distribute the data across the array and stores two parity blocks for each
data block.
Block-level striping with two parity blocks allows two disk failures before any data is
lost. This means that in an event where two disks fail, RAID can still reconstruct the
required data.
Its performance depends on how the array is implemented, as well as the total number
of drives. Write operations are slower compared to other configurations due to its
double parity feature.
Advantages of RAID 6
• High fault and drive-failure tolerance.
• Storage efficiency (when more than four drives are used).
• Fast read operations.
Disadvantages of RAID 6
• Rebuild time can take up to 24 hours.
• Slow write performance.
• Complex to implement.
• More expensive.