函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-27 16:48:29
Last Modify:2020-03-17 22:19:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:bool reuse_swap_page(struct page *page, int *total_map_swapcount)

返回类型:bool

参数:

类型参数名称
struct page *page
int *total_map_swapcount
1657  VM_BUG_ON_PAGE(!PageLocked(page), page)
1658  如果此条件成立可能性小(为编译器优化)(A KSM page is one of those write-protected "shared pages" or "merged pages"* which KSM maps into multiple mms, wherever identical anonymous page content* is found in VM_MERGEABLE vmas. It's a PageAnon page, pointing not to any)则返回:false
1660  count等于page_trans_huge_map_swapcount(page, & total_mapcount, & total_swapcount)
1662  如果total_map_swapcounttotal_map_swapcount等于total_mapcounttotal_swapcount
1664  如果count恒等于1且PageSwapCache(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.)或total_swapcount恒等于How many references to page are currently swapped out?* This does not give an exact answer when swap count is continued,* but does include the high COUNT_CONTINUED flag to allow for that.的值则
1669  page等于compound_head(page)
1671  SetPageDirty(page)
1672  否则
1676  val等于page_private(page)
1677  p等于swap_info_get(entry)
1680  返回:false
1686  返回:count小于等于1
调用者
名称描述
do_wp_pageThis routine handles present pages, when users try to write* to a shared page. It is done by copying the page to a new address* and decrementing the shared-page counter for the old page.* Note that this routine assumes that the protection checks have been
do_swap_pageWe enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with pte unmapped and unlocked.* We return with the mmap_sem locked or unlocked in the same cases
do_huge_pmd_wp_page
__collapse_huge_page_isolate