Inverted Paging

Inverted Paging:

  • To avoid the overhead of maintaining page table for every process the Inverted page table will  be implemented
  • In the Inverted paging only one page table will be maintained for all the processes
  • No.of entries in the Inverted page table will be same as the number of frames in PAS
  • The memory required to maintain page table for all the processes  will be less but search time for the corresponding page of a process will be more

 

 

 

 

 

 

Contributor's Info

Created:
0Comment
Segmentation

Segmentation:

  • Paging does not follow users  view of memory allocation 
  • To achieve users view of memory allocation ,the segmentation will be implemented
  • In the segmentation LAS will be divided in to various segments
  • Segments of LAS will  vary in the  size
  • Segments of LAS will be  brought in  to the PAS

 

s\rightarrowNo. of bits required to represents  the segments of  LAS or segment number

d\rightarrow No. of bits required to represents  the size of segments or word number of the segments or segment offset

  • Number of entries in segment table will  be  same  as number of segments in LAS

Ex .    d=210,L=200 then d<L 

210<200  trap to o.s

Ex .       d=190 L=200                       

190<200 then Base address+d=PAS  

  • The variable size segments are brought from LAS  to PAS so similarly behaving like variable partition scheme Hence segmentation still suffer from External fragmention

{\color{Red} Segmented Paging}

  • To avoid the overhead of bringing large size segments in to the memory ,the segmented paging will be implemented.
  • In the segmented paging ,paging will be applied  on  the segments and instead of bringing the entire segments in to the memory ,the pages of segments will be brought in to the memory

 

 

​Important points:

  • page size of segments is same as frame size of  PAS 
  • Number of entries in the page table of segments  is same as no. of pages on segments

Ques.Consider a system using segmented paging architecture.The segments is divided in to 1k pages and each page is having 512 entries.The segment number requires 17bits to repsents the segments in LAS and frame number requires 13 bits to represent the frame of PAS and memory is word addressable  and page table entry size is 2 words  .Then calculate:

  1. Length of LA
  2. Length of PA
  3. Page table size  of segment

Solution:

 

 

 

 

Contributor's Info

Created:
0Comment
Performance Of Paging

Performance of simple  paging:The  main memory access time is  ='m'.

  • page table are stored in main memory then formulae for Effective main memory access time =2*m
  • The tanslation look aside buffer(T.L.B) is added to improve the performance of paging
  • T.L.B  contains the frequently reffered page numbers and corresponding frame numbers.

TLB  access time ='c'

TLB hit ratio='x'

Then the formulae for effective main memory access time =x\ast \left ( c+m )+\left ( 1-x )\left ( c+2m )

Ques : consider a system which has  main memory access time is 100ns and TLB access time is 20ns and TLB hit ratio is 95% then what is the EMMAT with TLB and without TLB.

solution:

with TLB 

EMMAT=x\ast \left ( c+m )+\left ( 1-x )\left ( c+2m )

=0.95\ast \left ( 20+100 \right )+0.05(20+2\ast 100)

=125ns

without TLB

EMMAT=2\ast m

=2\ast 100 ns

=200ns

With TLB the performance is increased in paging

 

Performance of Multilevel  paging:

The  main memory access time is  ='m'.

  • page table are stored in main memory then formulae for Effective main memory access time =3*m
  • The tanslation look aside buffer(T.L.B) is added to improve the performance of paging
  • T.L.B  contains the frequently reffered page numbers and corresponding frame numbers.

TLB  access time ='c'

TLB hit ratio='x'

Then the formulae for effective main memory access time=

x\ast \left ( c+m \right )+\left ( 1-x \right )(c+3m)

For 'n' level paging

EMMAT=x\ast \left ( c+m \right )+\left ( 1-x \right )(c+(n+1)m)

Contributor's Info

Created:
0Comment
Introduction to Memory management and virtual memory

Operating System reside in part of memory and rest is used by multiple processes. A process needs some memory to store its variable and code. Operating system must manages memory location, either allocated or free. The efficient utilization of memory by minimizing internal and external fragmentation is the goal of memory management and it’s functionality is the allocating and deallocating memory to processes.

 

Main Memory refers to a physical memory that is the internal memory of the computer. The word main is used to distinguish it from external mass storage devices such as disk drives. Main memory is also known as RAM. The computer is able to change only data that is in main memory. Therefore, every program we execute and every file we access must be copied from a storage device into main memory.

All the programs are loaded in the main memeory for execution. Sometimes the complete program is loaded into the memory, but some times a certain part or routine of the program is loaded into the main memory only when it is called by the program, this mechanism is called Dynamic Loading, this enhances the performance.

Also, at times one program is dependent on some other program. In such a case, rather than loading all the dependent programs, CPU links the dependent programs to the main executing program when its required. This mechanism is known as Dynamic Linking.

 

Virtual Memory

Virtual Memory is a space where large programs can store themselves in form of pages while their execution and only the required pages or portions of processes are loaded into the main memory. This technique is useful as large virtual memory is provided for user programs when a very small physical memory is there.

In real scenarios, most processes never need all their pages at once, for following reasons :

  • Error handling code is not needed unless that specific error occurs, some of which are quite rare.
  • Arrays are often over-sized for worst-case scenarios, and only a small fraction of the arrays are actually used in practice.
  • Certain features of certain programs are rarely used.

 

Benefits of having Virtual Memory :

  1. Large programs can be written, as virtual space available is huge compared to physical memory.
  2. Less I/O required, leads to faster and easy swapping of processes.
  3. More physical memory available, as programs are stored on virtual memory, so they occupy very less space on actual physical memory.

Logical vs physical address space

The address generated by CPU is called logical (or virtual) address space. Processes are always uses virtual address space and they do not see physical address. Logical address space is set of logical addresses that generated by a program.

The physical address is address that seen by memory unit and used to access memory units. Virtual addresses are mapped with physical addresses by memory management unit.

 

                

   

Objective and Functions of MMU:

  • Memory management unit (MMU) is a hardware device that maps virtual addresses to physical addresses.
  • The functions of the memory management unit is raising exception when necessary, protection and translation of virtual to physical addresses. Operating system handles memory management unit

    

 

Contributor's Info

Created: Edited:
0Comment