Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\ksm.c Create Date:2022-07-28 15:40:29
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Removing rmap_item from stable or unstable tree.* This function will clean the information from the stable/unstable tree.

Proto:static void remove_rmap_item_from_tree(struct rmap_item *rmap_item)

Type:void

Parameter:

TypeParameterName
struct rmap_item *rmap_item
775  If + low bits used for flags below & s listed from the stable tree Then
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  If Not page Then Go to 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  If Not hlist_empty( & hlist) Then The number of page slots additionally sharing those nodes --
790  Else 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  Else if + low bits used for flags below & s a node of the unstable tree Then
807  age = seqnr - + low bits used for flags below
808  BUG_ON(age > 1)
809  If Not age Then rb_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()
Caller
NameDescribe
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