Q1. How can we optimize First In First Out Disk Scheduling Algorithm?
Ans.A simple optimization to FIFO algorithm is to attach a reference bit for each page in page table. Each time the page is accessed the page bit is set to 1. When a page fault occurs that respective bit is checked and if it is 1 then set the bit to 0 but jumps over that page and looks for another page but if the bit is 0 the page will be removed.
The idea is that the heavy used page in the table will not get out. But in the extreme case when all pages are in heavy use the algorithm will cycle through all the pages setting their bits to zero before finding the page to remove. If it might not find the page to replace, and the bit was set again while it was looking through the others, in which a case the paging system fails.