Operating Systems | Set 4

27 Mar, 2017
Following questions have been asked in GATE CS exam.
1. Using a larger block size in a fixed block size file system leads to (GATE CS 2003)a) better disk throughput but poorer disk space utilizationb) better disk throughput and better disk space utilizationc) poorer disk throughput but better disk space utilizationd) poorer disk throughput and poorer disk space utilization
Answer (a)If block size is large then seek time is less (fewer blocks to seek) and disk performance is improved, but remember larger block size also causes waste of disk space.
2. Consider the following statements with respect to user-level threads and kernel supported threadsi. context switch is faster with kernel-supported threadsii. for user-level threads, a system call can block the entire processiii. Kernel supported threads can be scheduled independentlyiv. User level threads are transparent to the kernel
Which of the above statements are true? (GATE CS 2004)a) (ii), (iii) and (iv) onlyb) (ii) and (iii) onlyc) (i) and (iii) onlyd) (i) and (ii) only
Answer(a)
http://en.wikipedia.org/wiki/Thread_%28computer_science%29
3. The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined by (GATE CS 2004)a) the instruction set architectureb) page sizec) physical memory sized) number of processes in memory
Answer (a)Each process needs minimum number of pages based on instruction set architecture. Example IBM 370: 6 pages to handle MVC (storage to storage move) instructionInstruction is 6 bytes, might span 2 pages.2 pages to handle from.2 pages to handle to.
4. In a system with 32 bit virtual addresses and 1 KB page size, use of one-level page tables for virtual to physical address translation is not practical because of (GATE CS 2003)a) the large amount of internal fragmentationb) the large amount of external fragmentationc) the large memory overhead in maintaining page tablesd) the large computation overhead in the translation process
Answer (c)Since page size is too small it will make size of page tables huge.
Size of page table =
  (total number of page table entries) *(size of a page table entry)

Let us see how many entries are there in page table
Number of entries in page table =
                    (virtual address space size)/(page size)
                    = (2^32)/(2^10) 
                    = 2^22

Now, let us see how big each entry is.
If size of physical memory is 512 MB then number of bits required to address a byte in 512 MB is 29. So, there will be (512MB)/(1KB) = (2^29)/(2^10) page frames in physical memory. To address a page frame 19 bits are required. Therefore, each entry in page table is required to have 19 bits.
Note that page table entry also holds auxiliary information about the page such 
as a present bit, a dirty or modified bit, address space or process ID information, 
amongst others. So size of page table 
    > (total number of page table entries) *(size of a page table entry)
    > (2^22 *19) bytes
    > 9.5 MB

And this much memory is required for each process because each process maintains its own page table. Also, size of page table will be more for physical memory more than 512MB. Therefore, it is advised to use multilevel page table for such scenarios.
References:http://barbara.stattenfield.org/ta/cs162/section-notes/sec8.txthttp://en.wikipedia.org/wiki/Page_table
Please see GATE Corner for all previous year paper/solutions/explanations, syllabus, important dates, notes, etc.
Please write comments if you find any of the answers/explanations incorrect, or you want to share more information about the topics discussed above.
GATE CS
MCQ
Operating Systems
Operating Systems
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.