函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Removing rmap_item from stable or unstable tree.* This function will clean the information from the stable/unstable tree.

函数原型:static void remove_rmap_item_from_tree(struct rmap_item *rmap_item)

返回类型:void

参数:

类型参数名称
struct rmap_item *rmap_item
775  如果 + low bits used for flags below 按位与s listed from the stable tree
779  stable_node等于 when listed from stable tree
780  page等于get_ksm_page: checks if the page indicated by the stable node* is still its ksm page, despite having held no reference to it.* In which case we can trust the content of the page, and it* returns the gotten page; but if the page has now been zapped,
781  如果非page则转到:out
784  hlist_del( & hlist)
785  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
786  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
788  如果非hlist_empty( & hlist)则The number of page slots additionally sharing those nodes 自减
790  否则The number of nodes in the stable tree 自减
792  VM_BUG_ON(rmap_hlist_len <= 0)
793  rmap_hlist_len自减
795  put_anon_vma( when stable )
796  + low bits used for flags below 与等于PAGE_MASK
798  否则如果 + low bits used for flags below 按位与s a node of the unstable tree
807  age等于seqnr + low bits used for flags below
808  BUG_ON(age > 1)
809  如果非agerb_erase( & when node of unstable tree , root_unstable_tree + NUMA( when node of unstable tree ))
812  The number of nodes in the unstable tree 自减
813  + low bits used for flags below 与等于PAGE_MASK
815  out :
816  cond_resched()
调用者
名称描述
remove_trailing_rmap_items
try_to_merge_with_ksm_pagery_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.
cmp_and_merge_pagemp_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
get_next_rmap_item