GATE CSE Operating Systems Formula Sheet: Paging, EAT, Deadlock
Operating systems numerical questions in GATE CSE come from a short list of formulas: scheduling times, effective access time, paging arithmetic, deadlock counts, inode sizes and fork counts. This sheet goes deeper than the general GATE CSE formula sheet. Each formula comes with a one-line worked example and the trap that costs marks.
In this guide
- Key takeaways
- The terms this sheet uses
- Scheduling formulas, from timeline to averages
- Paging arithmetic: entries, table size and levels
- Effective access time with a TLB
- Effective access time with page faults
- Deadlock: the minimum number of resources
- File-system formulas: inode size and disk accesses
- Process and semaphore counts
- Quick revision
Key takeaways
- Scheduling questions use three subtractions: turnaround is completion minus arrival, waiting is turnaround minus burst, and response is first dispatch minus arrival.
- The TLB formula charges a miss one memory access per page-table level plus the data access, so a two-level table costs on a miss.
- Demand-paging effective access time is dominated by the fault term, so convert milliseconds to nanoseconds before you multiply.
- Deadlock is impossible only with units; units can still deadlock.
- An inode's double indirect pointer reaches blocks, never .
- Most operating systems marks lost in revision come from units and conventions, not from the formulas themselves.
The terms this sheet uses
Every formula below is built from a few quantities. Learn them once and the formulas read like sentences.
- Arrival time () is when a process enters the ready queue. Burst time is the CPU time it needs. Completion time () is when it finishes.
- A page is a fixed-size block of virtual memory, and a frame is a block of physical memory of the same size. The offset is the part of an address that selects a byte inside a page, so offset bits .
- A page-table entry (PTE) holds a frame number plus flag bits. The TLB is a small cache of recent translations, and the hit ratio is the fraction of lookups it answers.
- The page-fault rate is the fraction of memory references whose page is not in memory.
- An inode stores a file's block pointers: direct pointers and one single, one double and one triple indirect pointer.
Logs are base 2 throughout, and KB means bytes unless a question says otherwise.
Scheduling formulas, from timeline to averages
Every scheduling question ends in the same three subtractions. Draw the Gantt chart first, read off completion times, then apply the table.
| Formula | One-line example | Watch out for |
|---|---|---|
| Arrives at 2, completes at 11: | Use completion, not the last dispatch | |
| Burst 4: | Context-switch time counts in waiting unless stated | |
| First runs at 6: | Response is not waiting in round robin | |
| CPU utilisation | , : | is the I/O-wait fraction, not the CPU fraction |
Two conventions decide many timelines. In round robin, a new arrival joins the queue before the preempted process when both happen at the same instant. In SRTF, a new arrival preempts only if its burst is strictly less than the running process's remaining time.
Trap: A quantum larger than every remaining burst turns round robin into FCFS. Count context switches only when the running process changes. The CPU scheduling question guide works through these timelines.
Paging arithmetic: entries, table size and levels
Single-level paging needs one idea: the page-number bits decide how many entries the table has. Multi-level paging adds a second idea: each inner table must fit in one page.
| Formula | One-line example | Watch out for |
|---|---|---|
| Pages | , 4 KB pages: pages | comes from the page size in bytes |
| Table size pages PTE size | PTE size given in bits versus bytes | |
| PTE bits | 1 GB RAM, 4 KB frames: frames, 18 bits plus flags | Frames come from physical memory, not virtual |
| Entries per page | , so 10 bits per level | Assumes every table fits in one page |
| Levels | , : levels | The top level may be partly used |
| Inverted table size frames entry size | frames 8 B | Scales with physical, not virtual, memory |
Remember: When you count the memory a sparse process uses for its page tables, the outer table always costs one full page, and every partly used inner table also costs a full page.
Effective access time with a TLB
The average time is the hit case weighted by its probability, plus the miss case weighted by its own. On a hit you pay one TLB lookup and one memory access. On a miss you pay the lookup, one access per page-table level, and then the data access:
Here is the TLB hit ratio, the lookup time, one memory access and the number of page-table levels.
Worked example. Take ns, ns, and a single-level table:
With a two-level table the miss term grows to ns, so the EAT becomes ns.
If the question says the TLB is searched in parallel with memory, the hit term is just and the miss term stays . The page-table walk always goes to memory.
Effective access time with page faults
Demand paging uses the same weighting, with the page-fault rate in place of the miss ratio:
Here is the fraction of victim pages that are dirty and must be written back.
Worked example. With ns, ms ns and , the fault term adds ns. The EAT is about ns.
Trap: Multiplying by 8 instead of gives an answer a million times too small. Write the unit next to every number before you substitute.
The page-replacement traces that feed these fault rates are covered in page replacement questions for GATE CSE.
The book's last-minute revision sheet gives the full operating systems formula table, with symbols, when each formula applies and its typical trap, alongside the same tables for the other nine subjects. It is part of the GATE CSE 2027 book.
Deadlock: the minimum number of resources
The worst case for one resource type is that every process holds one unit fewer than it needs. If one more unit exists, some process can finish and release everything. So deadlock is impossible exactly when:
| Formula | One-line example | Watch out for |
|---|---|---|
| Homogeneous: | 3 processes needing 4 each: | is still deadlock-prone |
| Largest for given , : | , : | Floor, not ceiling |
| Banker's: | Max 7, holds 2: need 5 | Compare a request with Need and Available, not Max |
File-system formulas: inode size and disk accesses
A block of bytes holds pointers. The single indirect pointer reaches blocks, the double and the triple , so:
Worked example. With KB, 4-byte pointers and , . The sum is blocks of 1 KB, a little over 16 GB.
| Formula | One-line example | Watch out for |
|---|---|---|
| Accesses for byte (inode cached): 1 if , 2 if , 3 if , else 4 | Byte 300 KB is block 300, which is and : 3 accesses | Add one if the inode itself must be read |
| FAT size blocks bits | 1 GB disk, 1 KB blocks: bits MB | Convert bits to bytes at the end |
| Bitmap size blocks bits | bits KB | One bit per block, not per byte |
In one line: Pointers per block is , each extra level of indirection multiplies the reach by , and each level costs one more disk access.
Process and semaphore counts
Two small formulas cover most counting questions on fork() and semaphores.
| Formula | One-line example | Watch out for |
|---|---|---|
| unconditional forks: processes, children | 3 forks: 8 processes, 7 children | A fork inside a branch runs only in that branch's process |
printf after a fork in an -iteration loop: lines |
: lines | Buffered output without a newline duplicates on fork |
| Blocked processes when | , five waits: , 3 blocked | A semaphore initialised to 0 blocks the first wait |
The operating systems important topics guide shows which of these families past papers have asked most, and the common mistakes guide lists the convention slips subject by subject.
More formula sheets: all of GATE CSE · Computer Networks · COA · Engineering Mathematics
Quick revision
- , , .
- TLB: ; one level gives on a miss.
- Demand paging: , with milliseconds converted to nanoseconds.
- Levels ; count the outer table as a full page.
- Deadlock-free needs units; the largest is .
- Inode: , with 1 to 4 disk accesses by pointer level.
- forks give processes and children.
Frequently asked questions
What is the effective access time formula with a TLB in GATE?
With a serial TLB lookup and an L-level page table, EAT . A hit costs one TLB lookup and one memory access. A miss costs the lookup, L page-table accesses and the data access. For a single-level table the miss term is . Read whether the question says the TLB lookup overlaps memory access.
How many resources are needed so that deadlock can never occur?
For one resource type, deadlock is impossible when the number of units R is at least the sum of (need minus one) over all processes, plus one. With n processes each needing k units this becomes . Exactly units is still deadlock-prone, because every process can hold units and wait forever.
How do I find the number of levels in a multi-level page table?
First find how many entries fit in one page: page size divided by the page-table entry size. The bits per level are the base-2 log of that number. Divide the page-number bits by the bits per level and take the ceiling. For example, 8 KB pages with 8-byte entries give 1,024 entries, so 10 bits per level, and 33 page-number bits need 4 levels.
What is the maximum file size formula for an inode?
Maximum file size , where d is the number of direct pointers, B is the block size and p is the number of pointers that fit in one block, block size divided by pointer size. The double indirect pointer reaches blocks and the triple indirect . Units are powers of two unless the question says otherwise.
Do I need to memorise operating system formulas for GATE CSE?
Yes. You cannot carry notes into the exam hall, and most operating system numerical questions in past papers reuse a small set of formulas: scheduling times, effective access time, paging levels, minimum resources for deadlock freedom and inode file size. Learn each with one worked example and its trap. Confirm the current exam-day rules at gate2027.iitm.ac.in.
Sources
Dates, fees and the syllabus are set by the GATE 2027 organising institute and can change. Always confirm at gate2027.iitm.ac.in.