Demand paging on Nand Flash

本文介绍了MTK代码中引入的Demand Paging功能及其工作原理,该功能类似于PC中的虚拟内存机制。文章详细阐述了其页错误处理流程,并列举了几种不适合使用Demand Paging的情况,包括实时应用、对性能敏感的应用等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

从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

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值