GATE / CS ARCHIVE

GATE CSE 2011 / QUESTION 6

Mode-switch and process-switch overhead

Operating Systems · Processes, Threads & System Calls · Full GATE CSE 2011 paper

GATE 2011, Q6 1 mark · MCQ
Report issue

Processes, Threads & System Calls

Question 6, GATE 2011: Let t1 be the time to switch between user and kernel execution modes, and t2 the time to switch between two processes. Which comparison is intended to hold?

(A) t1 > t2
(B) t1 = t2
(C) t1 < t2
(D) Nothing can be said about their relation
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Our answer: C in the conventional OS model

A user/kernel mode switch changes privilege and performs the associated entry/exit bookkeeping without necessarily changing the current process. A process context switch additionally saves/restores execution context and changes scheduling/address-space state. In the conventional comparison this costs more, giving t1<t2, C. It is an architectural cost-model comparison, not a hardware-independent numerical law for arbitrary implementations.

A system call can enter the kernel, do work for the same process, and return without scheduling another process. In a full context switch, the OS must preserve enough state to resume one process later and load another process's state; address-space switching may also entail translation/cache overhead. Thus a mode switch is conceptually a smaller operation. The question supplies no timings from which a numerical ratio could be calculated, only this conventional ordering.

Original paper, page 2 · Answer key