Function report | 
Source Code:mm\madvise.c | 
Create Date:2022-07-28 15:12:29 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:madvise_free_pte_range
Proto:static int madvise_free_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 | 
| 566 | nr_swap = 0 | 
| 569 | next = pmd_addr_end(addr, end) | 
| 570 | If pmd_trans_huge( * pmd) Then If Return true if we do MADV_FREE successfully on entire pmd page.* Otherwise, return false. Then | 
| 572 | Go to next | 
| 574 | If This is a noop if Transparent Hugepage Support is not built into* the kernel Then Return 0 | 
| 577 | tlb_change_page_size(tlb, PAGE_SIZE) | 
| 591 | If Not pte_present(ptent) Then | 
| 594 | entry = Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t. | 
| 595 | If non_swap_entry(entry) Then Continue | 
| 597 | nr_swap-- | 
| 598 | free_swap_and_cache(entry) | 
| 600 | Continue | 
| 604 | If Not page Then Continue | 
| 613 | If page_mapcount(page) != 1 Then Go to out | 
| 616 | If Not Return true if the page was successfully locked Then | 
| 620 | pte_unmap_unlock(orig_pte, ptl) | 
| 621 | If split_huge_page(page) Then | 
| 630 | pte-- | 
| 632 | Continue | 
| 635 | 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) | 
| 637 | If PageSwapCache(page) || PageDirty(page) Then | 
| 638 | If Not Return true if the page was successfully locked Then Continue | 
| 644 | If page_mapcount(page) != 1 Then | 
| 649 | If PageSwapCache(page) && Not try_to_free_swap(page) Then | 
| 654 | ClearPageDirty(page) | 
| 675 | out : | 
| 676 | If nr_swap Then | 
| 677 | If mm == mm Then sync_mm_rss(mm) | 
| 680 | add_mm_counter(mm, MM_SWAPENTS, nr_swap) | 
| 682 | arch_leave_lazy_mmu_mode() | 
| 683 | pte_unmap_unlock(orig_pte, ptl) | 
| 684 | cond_resched() | 
| 685 | next : | 
| 686 | 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  |