Function report | 
Source Code:mm\huge_memory.c | 
Create Date:2022-07-28 16:03:05 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:This calculates accurately how many mappings a transparent hugepage* has (unlike page_mapcount() which isn't fully accurate)
Proto:int page_trans_huge_mapcount(struct page *page, int *total_mapcount)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct page * | page | |
| int * | total_mapcount | 
| 2632 | VM_BUG_ON_PAGE(PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details., page) | 
| 2635 | mapcount = atomic_read( & * If the page can be mapped to userspace, encodes the number * of times this page is referenced by a page table.) + 1 | 
| 2636 | If total_mapcount Then total_mapcount = mapcount | 
| 2638 | Return mapcount | 
| 2641 | page = compound_head(page) | 
| 2643 | _total_mapcount = ret = 0 | 
| 2644 | When i < HPAGE_PMD_NR cycle | 
| 2645 | mapcount = atomic_read( & * If the page can be mapped to userspace, encodes the number * of times this page is referenced by a page table.) + 1 | 
| 2646 | ret = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(ret, mapcount) | 
| 2647 | _total_mapcount += mapcount | 
| 2650 | ret -= 1 | 
| 2651 | _total_mapcount -= HPAGE_PMD_NR | 
| 2653 | mapcount = compound_mapcount(page) | 
| 2655 | _total_mapcount += mapcount | 
| 2656 | If total_mapcount Then total_mapcount = _total_mapcount | 
| 2658 | Return ret | 
| 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  |