函数逻辑报告 |
Source Code:mm\khugepaged.c |
Create Date:2022-07-27 17:41:06 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:collapse_huge_page
函数原型:static void collapse_huge_page(struct mm_struct *mm, unsigned long address, struct page **hpage, int node, int referenced)
返回类型:void
参数:
类型 | 参数 | 名称 |
---|---|---|
struct mm_struct * | mm | |
unsigned long | address | |
struct page ** | hpage | |
int | node | |
int | referenced |
962 | VM_BUG_ON(address & ~HPAGE_PMD_MASK) |
974 | new_page等于khugepaged_alloc_page(hpage, gfp, node) |
975 | 如果非new_page则 |
977 | 转到:out_nolock |
980 | 如果此条件成立可能性小(为编译器优化)(mem_cgroup_try_charge(new_page, mm, gfp, & memcg, true))则 |
982 | 转到:out_nolock |
985 | lock for reading |
986 | result等于If mmap_sem temporarily dropped, revalidate vma* before taking mmap_sem.* Return 0 if succeeds, otherwise return none-zero* value (scan code). |
987 | 如果result则 |
993 | pmd等于mm_find_pmd(mm, address) |
994 | 如果非pmd则 |
1012 | lease a read lock |
1018 | lock for writing |
1019 | result等于SCAN_ANY_PROCESS |
1022 | result等于If mmap_sem temporarily dropped, revalidate vma* before taking mmap_sem.* Return 0 if succeeds, otherwise return none-zero* value (scan code). |
1026 | 如果mm_find_pmd(mm, address)不等于pmd则转到:out |
1031 | mmu_notifier_range_init( & range, MMU_NOTIFY_CLEAR, 0, NULL, mm, address, address + HPAGE_PMD_SIZE) |
1033 | mmu_notifier_invalidate_range_start( & range) |
1035 | pte等于pte_offset_map(pmd, address) |
1036 | pte_ptl等于pte_lockptr(mm, pmd) |
1045 | _pmd等于pmdp_collapse_flush(vma, address, pmd) |
1046 | 自旋锁解锁 |
1047 | mmu_notifier_invalidate_range_end( & range) |
1049 | 加自旋锁 |
1050 | isolated等于__collapse_huge_page_isolate(vma, address, pte) |
1051 | 自旋锁解锁 |
1053 | 如果此条件成立可能性小(为编译器优化)(!isolated)则 |
1077 | __SetPageUptodate(new_page) |
1078 | pgtable等于pmd_pgtable(_pmd) |
1081 | _pmd等于maybe_pmd_mkwrite(pmd_mkdirty(_pmd), vma) |
1088 | smp_wmb() |
1090 | 加自旋锁 |
1093 | mem_cgroup_commit_charge(new_page, memcg, TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., true) |
1094 | count_memcg_events(memcg, THP_COLLAPSE_ALLOC, 1) |
1096 | pgtable_trans_huge_deposit(mm, pmd, pgtable) |
1097 | set_pmd_at(mm, address, pmd, _pmd) |
1098 | update_mmu_cache_pmd(vma, address, pmd) |
1099 | 自旋锁解锁 |
1101 | * hpage = NULL |
1103 | khugepaged_pages_collapsed自加 |
1104 | result等于SCAN_SUCCEED |
1105 | out_up_write : |
1106 | lease a write lock |
1107 | out_nolock : |
1108 | trace_mm_collapse_huge_page(mm, isolated, result) |
1109 | 返回 |
1110 | out : |
1111 | mem_cgroup_cancel_charge(new_page, memcg, true) |
1112 | 转到:out_up_write |
名称 | 描述 |
---|---|
khugepaged_scan_pmd |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |