closed by
6,935 views
1 votes
1 votes
closed with the note: clear to me
Paging increases context switch time how and why ???
closed by

2 Answers

2 votes
2 votes

Context Switch basically means, taking CPU from one process and giving it to another process (which is in the ready queue and hence already loaded into memory).

Paging is way to manage memory efficiently by bringing into memory those part of the program which is required and keeping the rest of the disk and bring them as per need. Pages of other processes, which were brought into memory earlier might be evicted to make space for new processes.

So in the current situation, during a context switch, the new processes might find that most of its pages have been evicted, which needs to be brought back, which will take time, and hence the time to context switch is increased.

Imagine if there were no paging, then the whole program has to be kept into the memory and during a context switch, the new process will always find its all "parts (pages)" in the memory and hence, this will be very fast but very very very un efficient use of the memory, as we have to keep everything in the memory even if it is not required as of now.

Hope this helps. Please let me know if there are any doubts.

See this answer:

https://stackoverflow.com/a/54057079/2858560

edited by
0 votes
0 votes
In older OS, user PT(page table) was kept in secondary memory. Whenever context switch took place an hardware PT implemented using registers had to be loaded with user PT. This loading requires time thus making context switch longer for systems using paging.

In new OS which have large size PT, the PT (user PT) is being kept in main memory thus no need to load into registers( so no hardware PT).

Related questions

0 votes
0 votes
1 answer
1
1 votes
1 votes
1 answer
3
iarnav asked Jan 12, 2022
406 views
Does non preemptive CPU scheduling needs hardware support.kindly explain.
0 votes
0 votes
1 answer
4
Markzuck asked Dec 22, 2018
1,366 views
for memory overhead in Multi level paging, for innermost table only 1 page size shall be counted na? and NOT the complete page table size?please explain the concept, than...