Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:stable_node_dup

Proto: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)

Type:struct page

Parameter:

TypeParameterName
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  If Not prune_stale_stable_nodes || time_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) Then prune_stale_stable_nodes = false
1370  Else 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  If Not _tree_page Then Continue
1389  nr += 1
1390  If is_page_sharing_candidate(dup) Then
1391  If Not found || rmap_hlist_len > found_rmap_hlist_len Then
1395  found = dup
1400  If Not prune_stale_stable_nodes Then Break
1402  Continue
1405  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1408  If found Then
1415  If prune_stale_stable_nodes && nr == 1 Then
1422  BUG_ON(next)
1438  _stable_node = found
1445  stable_node = NULL
1446  Else if first != hlist_dup && __is_page_sharing_candidate(found, 1) Then
1463  hlist_del( & hlist_dup)
1469  _stable_node_dup = found
1470  Return tree_page
Caller
NameDescribe
__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