函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\ksm.c Create Date:2022-07-27 17:15:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:mp_and_merge_page - first see if page can be merged into the stable tree;* if not, compare checksum to previous and if it's the same, see if page can* be inserted into the unstable tree, or merged with a page already there and

函数原型:static void cmp_and_merge_page(struct page *page, struct rmap_item *rmap_item)

返回类型:void

参数:

类型参数名称
struct page *page
struct rmap_item *rmap_item
2037  mm等于mm
2039  struct page * tree_page = NULL
2044  bool max_page_sharing_bypass = false
2046  stable_node等于page_stable_node(page)
2047  如果stable_node
2055  如果when listed for migration 不等于Recently migrated nodes of stable tree, pending proper placement when listed from stable tree 恒等于stable_node则返回
2062  如果非is_page_sharing_candidate(stable_node)则max_page_sharing_bypass = true
2067  kpage等于stable_tree_search - search for page inside the stable tree* This function checks if there is a page inside the stable tree* with identical content to the page that we are scanning right now
2068  如果kpage恒等于page when listed from stable tree 恒等于stable_node
2069  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
2070  返回
2073  Removing rmap_item from stable or unstable tree.* This function will clean the information from the stable/unstable tree.
2075  如果kpage
2076  如果错误恒等于负EBUSY则返回
2079  err等于ry_to_merge_with_ksm_page - like try_to_merge_two_pages,* but no new kernel page is allocated: kpage must already be a ksm page.* This function returns 0 if the pages were merged, -EFAULT otherwise.
2080  如果非err
2090  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
2091  返回
2100  checksum等于calc_checksum(page)
2101  如果 when unstable 不等于checksum
2102  when unstable 等于checksum
2103  返回
2110  如果Whether to merge empty (zeroed) pages with actual zero pages checksum恒等于Checksum of an empty (zeroed) page
2113  lock for reading
2114  vma等于find_mergeable_vma(mm, + low bits used for flags below )
2115  err等于ry_to_merge_one_page - take two pages and merge them into one*@vma: the vma that holds the pte pointing to page*@page: the PageAnon page that we want to replace with kpage*@kpage: the PageKsm page that we want to map instead of page,
2117  lease a read lock
2122  如果非err则返回
2125  tree_rmap_item等于stable_tree_search_insert - search for identical page,* else insert rmap_item into the unstable tree.* This function searches for a page in the unstable tree identical to the* page currently being scanned; and if no identical page is found in the
2127  如果tree_rmap_item
2130  kpage等于ry_to_merge_two_pages - take two identical pages and prepare them* to be merged into one page
2142  split等于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.compound_head(page)恒等于compound_head(tree_page)
2144  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
2145  如果kpage
2152  如果stable_node
2166  如果非stable_node
2170  否则如果split
调用者
名称描述
ksm_do_scanksm_do_scan - the ksm scanner main worker function.*@scan_npages: number of pages we want to scan before we return.