Function report |
Source Code:mm\madvise.c |
Create Date:2022-07-28 15:12:13 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:madvise_cold_or_pageout_pte_range
Proto:static int madvise_cold_or_pageout_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| pmd_t * | pmd | |
| unsigned long | addr | |
| unsigned long | end | |
| struct mm_walk * | walk |
| 314 | If fatal_signal_pending(current process) Then Return -EINTR |
| 318 | If pmd_trans_huge( * pmd) Then |
| 320 | next = pmd_addr_end(addr, end) |
| 324 | If Not ptl Then Return 0 |
| 328 | If is_huge_zero_pmd(orig_pmd) Then Go to huge_unlock |
| 334 | Go to huge_unlock |
| 337 | page = Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(orig_pmd) |
| 338 | If next - addr != HPAGE_PMD_SIZE Then |
| 341 | If page_mapcount(page) != 1 Then Go to huge_unlock |
| 345 | spin_unlock(ptl) |
| 347 | err = split_huge_page(page) |
| 350 | If Not err Then Go to regular_page |
| 352 | Return 0 |
| 356 | pmdp_invalidate(vma, addr, pmd) |
| 359 | set_pmd_at(mm, addr, pmd, orig_pmd) |
| 360 | tlb_remove_pmd_tlb_entry(tlb, pmd, addr) |
| 363 | ClearPageReferenced(page) |
| 365 | If pageout Then |
| 374 | huge_unlock : |
| 375 | spin_unlock(ptl) |
| 376 | If pageout Then reclaim_pages( & page_list) |
| 378 | Return 0 |
| 381 | If This is a noop if Transparent Hugepage Support is not built into* the kernel Then Return 0 |
| 383 | regular_page : |
| 385 | tlb_change_page_size(tlb, PAGE_SIZE) |
| 386 | orig_pte = pte = pte_offset_map_lock(The address space we belong to. , pmd, addr, & ptl) |
| 395 | If Not pte_present(ptent) Then Continue |
| 399 | If Not page Then Continue |
| 407 | If page_mapcount(page) != 1 Then Break |
| 410 | If Not Return true if the page was successfully locked Then |
| 414 | pte_unmap_unlock(orig_pte, ptl) |
| 415 | If split_huge_page(page) Then |
| 418 | pte_offset_map_lock(mm, pmd, addr, & ptl) |
| 419 | Break |
| 424 | pte-- |
| 426 | Continue |
| 429 | VM_BUG_ON_PAGE(PageTransCompound returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved., page) |
| 432 | ptent = ptep_get_and_clear_full(mm, addr, pte, we are in the middle of an operation to clear* a full mm and can make some optimizations) |
| 435 | set_pte_at(mm, addr, pte, ptent) |
| 445 | ClearPageReferenced(page) |
| 447 | If pageout Then |
| 458 | arch_leave_lazy_mmu_mode() |
| 459 | pte_unmap_unlock(orig_pte, ptl) |
| 460 | If pageout Then reclaim_pages( & page_list) |
| 462 | cond_resched() |
| 464 | Return 0 |
| 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 |