12. Buffer Cache - 1 UNIX Kernel Architecture libraries...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
1 UNIX Kernel Architecture libraries User level Kernel level User programs hardware Kernel level Hardware level trap Sytem call interface File subsytem Buffer cache Chracter block Device drivers Hardware control Inter-process communication scheduler Memory management Process control sybsystem
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
System Calls System call are similar to ordinary functions Libraries map these function call to primitives needed to enter OS Assembly programs can directly invoke system call System calls can be categorized into : File subsystem related calls Process control system related calls 2
Image of page 2
File subsystem related calls Allocating file space Free space management File access control open, close read, write, stat, chown, chmode etc Process control system related calls Process synchronization Interprocess communication Memory management Process scheduling Fork, exec, wait, exit etc. 3
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Buffering File subsystem accesses file data using buffering mechanism The mechanism regulates the flow between buffer and secondary storage The mechanism interacts with block i/o device driver to initiate the data transfer block I/O devices are random access storage devices Device drivers are kernel module that controls the device operation 5
Image of page 4
6 Buffer Cache When a process wants to access data from a file, the kernel brings the data into main memory, alters it and then request to save in the file system Buffering improves the response time , throughput Buffering minimizes the frequency of disk access by keeping a pool of internal data buffer called buffer cache.
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
7 Buffer Cache Buffer cache contains the data in recently used disk blocks When reading data from disk, the kernel attempts to read from buffer cache. If data is already in the buffer cache, the kernel does not need to read from disk If data is not in the buffer cache, the kernel reads the data from disk and cache it
Image of page 6
8 Buffer Headers A buffer consists of two parts a memory array buffer header disk block : buffer = 1 : 1 Buffer Header device num block num status ptr to next buf on hash queue ptr to previous buf on hash queue ptr to next buf on free list ptr to previous buf on free list ptr to data area
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
9 Buffer Headers device num logical file system number block num block number of the data on disk status The buffer is currently locked/busy.
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern