2 Mar 2017

Unix 3.3 Structure of the Buffer Pool


STRUCTURE OF THE BUFFER POOL 




Structure of the Buffer Pool

The kernel caches the least recently used data into the buffer pool. Once a back from buffer pool is allocated for a file of the system this block cannot be used for any other file’s data. The kernel also maintains a free list of buffers. The free list is a doubly circular list of buffers.
When kernel wants to allocate any buffer it removes a node from the free list, usually from the beginning of list but is could take it from middle of the list too. When kernel frees a node from the buffer list it adds this free node at the end of the free list.


When kernel want to access the disk it searches the buffer pool for a particular device number-block number combination (which is maintained in the buffer header).
The entire buffer pool is organized as queues hashed as a function of device number-block number combination. The figure down below shows the buffers on their hash queues.


The important thing to note here is that no two nodes in the buffer pool can contain the data of same disk block i.e. same file.

Friends, if you find this post useful please comment below. If you want quick notes for any topic please mail us at hardikpanchal551@gmail.com, we will try to provide notes if possible. Thanks for reading.

2 comments:

  1. Thank you so much for your efforts to create a easy to understand to us . The buffer pool notes is very understandable .

    ReplyDelete
  2. Anonymous8:17 pm

    🙏

    ReplyDelete