Function report |
Source Code:mm\khugepaged.c |
Create Date:2022-07-28 16:06:49 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:collapse_huge_page
Proto:static void collapse_huge_page(struct mm_struct *mm, unsigned long address, struct page **hpage, int node, int referenced)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
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 | If Not new_page Then |
977 | Go to out_nolock |
980 | If Value for the false possibility is greater at compile time(mem_cgroup_try_charge(new_page, mm, gfp, & memcg, true)) Then |
982 | Go to 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 | If result Then |
993 | pmd = mm_find_pmd(mm, address) |
994 | If Not pmd Then |
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 | If mm_find_pmd(mm, address) != pmd Then Go to 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 | spin_unlock(pmd_ptl) |
1047 | mmu_notifier_invalidate_range_end( & range) |
1050 | isolated = __collapse_huge_page_isolate(vma, address, pte) |
1051 | spin_unlock(pte_ptl) |
1077 | __SetPageUptodate(new_page) |
1078 | pgtable = pmd_pgtable(_pmd) |
1081 | _pmd = maybe_pmd_mkwrite(pmd_mkdirty(_pmd), vma) |
1088 | smp_wmb() |
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 | spin_unlock(pmd_ptl) |
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 | Return |
1110 | out : |
1111 | mem_cgroup_cancel_charge(new_page, memcg, true) |
1112 | Go to out_up_write |
Name | Describe |
---|---|
khugepaged_scan_pmd |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |