页表的释放
mmu_gather
struct mmu_gather
+------------------------------+
|mm |
| (struct mm_struct*) |
|start/end |
| (unsigned long) |
|page_size | // granularity of zap?
| (unsigned int) |
| |
|batch | // 专门给页表页释放做缓存
| (struct mmu_table_batch*) |
| +--------------------------+
| |nr | // 攒够了一起tlb_table_flush()
| | (unsigned int) |
| |tables[] |
| | (void *) |
| +--------------------------+
| |
|batch_count | // 已经分配了多少mmu_gather_batch
| (unsigned int) |
|*active | // active = &local
|local |
| (struct mmu_gather_batch) |
| +--------------------------+
| |next |
| |(struct mmu_gather_batch*)|
| | |
| |nr/max |
| | (unsigned int) |
| |encoded_pages[] |
| | (void *) |
| +--------------------------+
|__pages[] | // 给上面的local用作encoded_pages[]的
| (struct page *) |
| |
|// indicators |
| |
|fullmm |
|need_flush_all |
| |
|freed_tables | // removed page directories
| |
|cleared_ptes | // the level we cleared
|cleared_pmds |
|cleared_puds |
|cleared_p4ds |
| |
+------------------------------+
API分析
释放进程页
缓存进程页
释放进程页
释放页表页
缓存页表页
释放页表页
刷新tlb
代码分析
free_pte_range必定释放一个PMD(2M)空间
CONFIG_MMU_GATHER_RCU_TABLE_FREE 和 CONFIG_PT_RECLAIM
MMU_GATHER_RCU_TABLE_FREE
PT_RECLAIM
Last updated