Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static struct rmap_item *unstable_tree_search_insert(struct rmap_item *rmap_item, struct page *page, struct page **tree_pagep)

Type:struct rmap_item

Parameter:

TypeParameterName
struct rmap_item *rmap_item
struct page *page
struct page **tree_pagep
1929  struct rb_node * parent = NULL
1932  nid = This helper is used for getting right index into array of tree roots.* When merge_across_nodes knob is set to 1, there are only two rb-trees for* stable and unstable pages from all nodes with roots in index 0. Otherwise,
1933  root = root_unstable_tree + nid
1934  new = rb_node
1936  When new cycle
1941  cond_resched()
1942  tree_rmap_item = rb_entry( * new, structrmap_item, node)
1943  tree_page = get_mergeable_page(tree_rmap_item)
1944  If Not tree_page Then Return NULL
1950  If page == tree_page Then
1952  Return NULL
1955  ret = memcmp_pages(page, tree_page)
1957  parent = new
1958  If ret < 0 Then
1960  new = rb_left
1961  Else if ret > 0 Then
1963  new = rb_right
1972  Return NULL
1973  Else
1975  Return tree_rmap_item
1979  + low bits used for flags below |= s a node of the unstable tree
1980  + low bits used for flags below |= seqnr & low bits of unstable tree seqnr
1981  DO_NUMA( when node of unstable tree = nid)
1982  rb_link_node( & when node of unstable tree , parent, new)
1983  rb_insert_color( & when node of unstable tree , root)
1985  The number of nodes in the unstable tree ++
1986  Return NULL
Caller
NameDescribe
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