1 / 15

UNIX buffer management

UNIX buffer management one of the critical component of the operating system<br>

Ayan22
Download Presentation

UNIX buffer management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UNIX Buffer Managemen Prepared By:Ayan Banerjee Master of Technology (M.tech)-Computer Science & Engineering UNIX Buffer Management UNIX Buffer Management Operating System – I/O Subsystem Buffer Cache, Free List, Hash Queues

  2. Introduction • UNIX buffer management is a critical component of the operating system • It handles efficient transfer of data between disk and memory and vice-versa • Reduces direct disk access by caching disk blocks • Improves overall system performance and throughput and increase system efficiency

  3. What is a Buffer? • A buffer is a temporary storage area in main memory • Used during data transfer between CPU and I/O devices • Helps handle speed mismatch between disk and processor • Commonly used in file systems and device drivers

  4. Need for Buffer Management • Disk access time is much slower than memory access • Frequent disk I/O degrades system performance • Buffers reduce redundant read/write operations • Enables efficient multitasking in UNIX

  5. UNIX Buffer Cache • Buffer cache is a pool of buffers in RAM • Each buffer stores one disk block • Shared among all processes in the system • Avoids repeated disk reads for same data

  6. UNIX Buffer Cache • Buffer cache is a pool of buffers in RAM • Each buffer stores one disk block • Shared among all processes in the system • Avoids repeated disk reads for same data

  7. Buffer States • Locked (Busy): buffer currently in use • Valid: buffer contains correct data • Delayed Write: data modified but not written to disk • States ensure synchronization and data consistency

  8. Free List • Free list holds buffers not currently in use • Implemented as a circular doubly linked list • Buffers are reused efficiently • Helps in fast buffer allocation

  9. Hash Queues • Hash queues provide fast buffer lookup • Hash function uses device number and block number • Each hash queue is a linked list of buffers • Reduces buffer search time significantly

  10. Buffer Allocation Algorithm • Check hash queue for requested block • If buffer exists and is free → allocate it • If buffer is busy → process waits • If block not present → take buffer from free list

  11. Delayed Write Mechanism • Modified buffers are not written immediately • Buffer marked as delayed write • Improves performance by reducing disk writes • Disk write occurs during replacement or sync

  12. Read Operation in UNIX • Process makes a read system call • Kernel checks buffer cache first • If block present → data copied to user space • If not → block read from disk into buffer

  13. Write Operation in UNIX • Data written to buffer cache initially • Buffer marked as delayed write • Process does not wait for disk write • Kernel writes data to disk late

  14. Advantages of Buffer Management • Minimizes disk I/O operations • Improves system response time • Supports efficient multi-process access • Enhances UNIX file system performance

  15. Conclusion • UNIX buffer management is essential for OS efficiency • Combines buffer cache, hash queues, and free list • Ensures fast, consistent, and reliable I/O • Forms the backbone of UNIX file systems

More Related