GATE 2004
199 questions
MCQ 1991-mark 199
Questions 141–145 of 199
Consider an operating system capable of loading and executing a single sequential user process at a time. The disk head scheduling algorithm used is First Come First Served (FCFS). If FCFS is replaced by Shortest Seek Time First (SSTF), claimed by the vendor to give 50% better benchmark results, what is the expected improvement in the I/O performance of user programs?
Answer: (D)
The question says there is a "single sequential user process". So every request reaches the disk scheduler one after another, and each request blocks the process until it finishes. This means a disk scheduling algorithm makes no difference. Any algorithm gets the same input sequence. So the improvement of SSTF over FCFS will be .
Correct Answer:
Correct Answer:
In a virtual memory system, size of the virtual address is 32-bit, size of the physical address is 30-bit, page size is 4 Kbyte and size of each page table entry is 32-bit. The main memory is byte addressable. Which one of the following is the maximum number of bits that can be used for storing protection and other information in each page table entry?
Answer: (D)
Each page table entry holds a frame number plus extra bits (protection, dirty, reference, valid and so on). The entry is 32 bits, so the extra bits are whatever is left after the frame number.
Number of frames
So the frame number needs 18 bits.
Let x be the number of other bits. Then , so bits.
Answer: (D)
Number of frames
So the frame number needs 18 bits.
Let x be the number of other bits. Then , so bits.
Answer: (D)
Consider a system with a two-level paging scheme in which a regular memory access takes 150 nanoseconds, and servicing a page fault takes 8 milliseconds. An average instruction takes 100 nanoseconds of CPU time, and two memory accesses. The TLB hit ratio is 90%, and the page fault rate is one in every 10,000 instructions. What is the effective average instruction execution time?
Answer: (D)
Average time per instruction = CPU time + memory access time + address translation time + page fault time.
CPU time = 100 ns.
Memory accesses: ns.
Address translation (one translation per instruction, TLB time taken as 0): a TLB hit costs nothing. A miss, 10% of the time, needs 2 page-table accesses in two-level paging: ns.
Page faults: ns.
Total = 100 + 300 + 30 + 800 = 1230 ns. Charging a translation for each of the two memory accesses would give 1260 ns instead, so the one-translation reading is the one that matches 1230 ns.
Answer: (D)
CPU time = 100 ns.
Memory accesses: ns.
Address translation (one translation per instruction, TLB time taken as 0): a TLB hit costs nothing. A miss, 10% of the time, needs 2 page-table accesses in two-level paging: ns.
Page faults: ns.
Total = 100 + 300 + 30 + 800 = 1230 ns. Charging a translation for each of the two memory accesses would give 1260 ns instead, so the one-translation reading is the one that matches 1230 ns.
Answer: (D)
The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined by
Answer: (A)
The OS must give a process enough frames for one instruction to complete. That number is the most distinct pages a single instruction can touch, and it depends on the instruction set architecture.
No indirect addressing: 1 page for the instruction + 1 for the operand = 2 frames.
One level of indirection: the instruction page, the page holding the address, and the operand page = 3 frames.
Two levels: 4 frames. Three levels: 5 frames.
Page size, physical memory size and the number of processes affect how many frames the OS can give, not how many the process needs at minimum.
Answer: (A)
No indirect addressing: 1 page for the instruction + 1 for the operand = 2 frames.
One level of indirection: the instruction page, the page holding the address, and the operand page = 3 frames.
Two levels: 4 frames. Three levels: 5 frames.
Page size, physical memory size and the number of processes affect how many frames the OS can give, not how many the process needs at minimum.
Answer: (A)
In a particular Unix OS, each data block is of size 1024 bytes, each node has 10 direct data block addresses and three additional addresses: one for single indirect block, one for double indirect block and one for triple indirect block. Also, each block can contain addresses for 128 blocks. Which one of the following is approximately the maximum size of a file in the file system?
Answer: (B)
The largest file uses all the direct blocks and all the indirect blocks. Each block is 1024 bytes and holds 128 addresses.
Number of data blocks =
Size = bytes
The triple indirect part is bytes = 2 GB.
The other parts together are MB, which is small next to 2 GB.
So the maximum file size is about 2 GB.
Answer: (B)
Number of data blocks =
Size = bytes
The triple indirect part is bytes = 2 GB.
The other parts together are MB, which is small next to 2 GB.
So the maximum file size is about 2 GB.
Answer: (B)