函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:stable_node_dup

函数原型:static struct page *stable_node_dup(struct stable_node **_stable_node_dup, struct stable_node **_stable_node, struct rb_root *root, bool prune_stale_stable_nodes)

返回类型:struct page

参数:

类型参数名称
struct stable_node **_stable_node_dup
struct stable_node **_stable_node
struct rb_root *root
boolprune_stale_stable_nodes
1359  found等于NULL, stable_node等于_stable_node
1361  struct page * _tree_page, * tree_page = NULL
1362  nr等于0
1365  如果非prune_stale_stable_nodestime_before(jiffies, chain_prune_time + msecs_to_jiffies: - convert milliseconds to jiffies*@m: time in milliseconds* conversion is done as follows:* - negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET)* - 'too large' values [that would result in larger than)则prune_stale_stable_nodes = false
1370  否则chain_prune_time等于jiffies
1375  cond_resched()
1386  _tree_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,
1387  如果非_tree_page则继续下一循环
1389  nr加等于1
1390  如果is_page_sharing_candidate(dup)则
1391  如果非foundrmap_hlist_len大于found_rmap_hlist_len
1395  found等于dup
1397  tree_page等于_tree_page
1400  如果非prune_stale_stable_nodes退出
1402  继续下一循环
1405  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1408  如果found
1415  如果prune_stale_stable_nodesnr恒等于1则
1422  BUG_ON(next)
1438  _stable_node等于found
1445  stable_node = NULL
1446  否则如果first不等于hlist_dup__is_page_sharing_candidate(found, 1)则
1463  hlist_del( & hlist_dup)
1469  _stable_node_dup等于found
1470  返回:tree_page
调用者
名称描述
__stable_node_chainLike for get_ksm_page, this function can free the *_stable_node and* *_stable_node_dup if the returned tree_page is NULL