函数逻辑报告 |
Source Code:mm\khugepaged.c |
Create Date:2022-07-27 17:41:15 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:khugepaged_scan_pmd
函数原型:static int khugepaged_scan_pmd(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, struct page **hpage)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct mm_struct * | mm | |
struct vm_area_struct * | vma | |
unsigned long | address | |
struct page ** | hpage |
1122 | ret等于0, none_or_zero等于0, result等于0, referenced等于0 |
1126 | node等于NUMA_NO_NODE, unmapped等于0 |
1127 | bool writable = false |
1129 | VM_BUG_ON(address & ~HPAGE_PMD_MASK) |
1131 | pmd等于mm_find_pmd(mm, address) |
1132 | 如果非pmd则 |
1133 | result等于SCAN_PMD_NULL |
1134 | 转到:out |
1137 | memset(khugepaged_node_load, 0, khugepaged_node_load的长度) |
1139 | 以_pte小于pte加HPAGE_PMD_NR循环 |
1143 | 如果unmapped先自加小于等于khugepaged_max_ptes_swap则 |
1144 | 继续下一循环 |
1145 | 否则 |
1146 | result等于SCAN_EXCEED_SWAP_PTE |
1147 | 转到:out_unmap |
1150 | 如果pte_none(pteval)或is_zero_pfn(pte_pfn(pteval))则 |
1159 | 如果非pte_present(pteval)则 |
1160 | result等于SCAN_PTE_NON_PRESENT |
1161 | 转到:out_unmap |
1167 | 如果此条件成立可能性小(为编译器优化)(!page)则 |
1168 | result等于SCAN_PAGE_NULL |
1169 | 转到:out_unmap |
1173 | 如果PageCompound(page)则 |
1174 | result等于SCAN_PAGE_COMPOUND |
1175 | 转到:out_unmap |
1184 | node等于page_to_nid(page) |
1185 | 如果khugepaged_scan_abort(node)则 |
1186 | result等于SCAN_SCAN_ABORT |
1187 | 转到:out_unmap |
1189 | khugepaged_node_load[node]自加 |
1191 | result等于SCAN_PAGE_LRU |
1192 | 转到:out_unmap |
1194 | 如果PageLocked(page)则 |
1195 | result等于SCAN_PAGE_LOCK |
1196 | 转到:out_unmap |
1199 | result等于SCAN_PAGE_ANON |
1200 | 转到:out_unmap |
1208 | 如果page_count(page)不等于1加PageSwapCache(page)则 |
1209 | result等于SCAN_PAGE_COUNT |
1210 | 转到:out_unmap |
1217 | 如果writable则 |
1224 | 否则 |
1225 | result等于SCAN_PAGE_RO |
1227 | out_unmap : |
1228 | pte_unmap_unlock(pte, ptl) |
1229 | 如果ret则 |
1230 | node等于khugepaged_find_target_node() |
1232 | collapse_huge_page(mm, address, hpage, node, referenced) |
1234 | out : |
1237 | 返回:ret |
名称 | 描述 |
---|---|
khugepaged_scan_mm_slot |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |