Function report |
Source Code:mm\swapfile.c |
Create Date:2022-07-28 15:18:00 |
Last Modify:2020-03-17 22:19:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:page_trans_huge_map_swapcount
Proto:static int page_trans_huge_map_swapcount(struct page *page, int *total_mapcount, int *total_swapcount)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct page * | page | |
int * | total_mapcount | |
int * | total_swapcount |
1585 | offset = 0 |
1587 | struct swap_cluster_info * ci = NULL |
1588 | unsigned char * map = NULL |
1589 | swapcount = 0 |
1592 | VM_BUG_ON_PAGE(PageHuge(page), page) |
1598 | If total_swapcount Then total_swapcount = swapcount |
1603 | page = compound_head(page) |
1605 | _total_mapcount = _total_swapcount = map_swapcount = 0 |
1606 | If PageSwapCache(page) Then |
1616 | If map Then ci = lock_cluster(si, offset) |
1618 | When i < HPAGE_PMD_NR cycle |
1619 | 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 |
1620 | _total_mapcount += mapcount |
1621 | If map Then |
1622 | swapcount = swap_count(map[offset + i]) |
1623 | _total_swapcount += swapcount |
1627 | unlock_cluster(ci) |
1629 | map_swapcount -= 1 |
1630 | _total_mapcount -= HPAGE_PMD_NR |
1632 | mapcount = compound_mapcount(page) |
1633 | map_swapcount += mapcount |
1634 | _total_mapcount += mapcount |
1635 | If total_mapcount Then total_mapcount = _total_mapcount |
1637 | If total_swapcount Then total_swapcount = _total_swapcount |
1640 | Return map_swapcount |
Name | Describe |
---|---|
reuse_swap_page | We can write to an anon page without COW if there are no other references* to it. And as a side-effect, free up its swap: because the old content* on disk will never be read, and seeking back there to write new content |
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 |