函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:static struct rmap_item *unstable_tree_search_insert(struct rmap_item *rmap_item, struct page *page, struct page **tree_pagep)

返回类型:struct rmap_item

参数:

类型参数名称
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_treenid
1934  new等于rb_node
1936 new循环
1941  cond_resched()
1942  tree_rmap_item等于rb_entry( * new, structrmap_item, node)
1943  tree_page等于get_mergeable_page(tree_rmap_item)
1944  如果非tree_page则返回:NULL
1950  如果page恒等于tree_page
1952  返回:NULL
1955  ret等于memcmp_pages(page, tree_page)
1957  parent等于new
1958  如果ret小于0则
1960  new等于rb_left
1961  否则如果ret大于0则
1963  new等于rb_right
1972  返回:NULL
1973  否则
1974  tree_pagep等于tree_page
1975  返回: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  返回:NULL
调用者
名称描述
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