Demand paging on Nand Flash

从08A开始, MTK代码引入了Demand paging 的功能.

原理: 类似于PC中的虚拟内存.

Page fault handler:

1. Prefetch Abort   or  Data Abort

2. Abort ISR

3. do_page_fault()

{

       alloc_page();

       load_img_page();

       go_back();

}

 

 

If demp_page_pool is full, system will replace one memory page based on a LRU algorithm.

 

 

Below is the limitation of demand paging:

1. Just RO(Data and Code)  can be put in Demp.  RW can't be put in Demp.

2. Real-time applications such as L1 cannot apply because the execution time will become non-deterministic. HISR and LISR also can't apply as the same reason.

3. Demand Paging will sometimes cause the task priority reversal. As do_page_fault needs to take the NFI_mutex when swaping a page. But NFI_mutex may be occuiped by another task. So that may be your current higher task will be suspended for lack of NFI_mutex and the lower task runs. So the system will also be non-deterministic.

4. Code or Data used in the primary MAUI can't be applied as demp hasn't be initialized yet.

5. Read-only data used by hardware modules(such as fonts used by 2D engine, or data used by DMA)can't be applied. When page fault occurs, system will load the faulted memory page into the memory pool(demp_page_pool).

The actually physical adress of the memory  page will differ from its virtual address screen by MCU. But the hardware decoder cannot reference the virtual address. 

 

 

Brief summary:

1.Performance-sensitive applications

2.Tasks which cannot afford unpredictable suspension

3.Codes and data which will be accessed in Primary MAUI

4.Hardware-accessed data

   

   

   

  

  

  

  

   2011-03-31       16:48:31

 

 

 

 

你可能感兴趣的:(mtk)