函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:stable_tree_search - search for page inside the stable tree* This function checks if there is a page inside the stable tree* with identical content to the page that we are scanning right now

函数原型:static struct page *stable_tree_search(struct page *page)

返回类型:struct page

参数:

类型参数名称
struct page *page
1560  page_node等于page_stable_node(page)
1561  如果page_nodewhen listed for migration 不等于Recently migrated nodes of stable tree, pending proper placement
1563  get_page(page)
1564  返回:page
1567  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,
1568  root等于root_stable_treenid
1569  again :
1570  new等于rb_node
1571  parent = NULL
1573 new循环
1577  cond_resched()
1578  stable_node等于rb_entry( * new, structstable_node, node)
1579  stable_node_any = NULL
1580  tree_page等于chain_prune( & stable_node_dup, & stable_node, root)
1593  如果非stable_node_dup
1601  如果非stable_node_any
1603  转到:again
1617  VM_BUG_ON(!stable_node_dup ^ !!stable_node_any)
1618  如果非tree_page
1628  转到:again
1631  ret等于memcmp_pages(page, tree_page)
1632  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1634  parent等于new
1635  如果ret小于0则new等于rb_left
1637  否则如果ret大于0则new等于rb_right
1639  否则
1640  如果page_node
1652  如果非stable_node_dup
1665  返回:NULL
1678  如果错误恒等于负EBUSY则返回:错误号
1694  返回:tree_page
1698  如果非page_node则返回:NULL
1701  删除链表项
1702  DO_NUMA(nid = nid)
1703  rb_link_node( & when node of stable tree , parent, new)
1704  rb_insert_color( & when node of stable tree , root)
1705  out :
1706  如果is_page_sharing_candidate(page_node)则
1707  get_page(page)
1708  返回:page
1709  否则返回:NULL
1712  replace :
1721  如果stable_node_dup恒等于stable_node
1722  VM_BUG_ON(is_stable_node_chain(stable_node_dup))
1723  VM_BUG_ON(is_stable_node_dup(stable_node_dup))
1725  如果page_node
1728  DO_NUMA(nid = nid)
1734  否则page = NULL
1736  否则
1738  page = NULL
1740  否则
1741  VM_BUG_ON(!is_stable_node_chain(stable_node))
1742  __stable_node_dup_del(stable_node_dup)
1743  如果page_node
1746  DO_NUMA(nid = nid)
1750  否则page = NULL
1752  否则
1753  page = NULL
1756  when listed for migration 等于Recently migrated nodes of stable tree, pending proper placement
1757  添加链表项
1758  返回:page
1760  chain_append :
1762  如果非stable_node_dupstable_node_dup等于stable_node_any
1772  如果stable_node_dup恒等于stable_node
1773  VM_BUG_ON(is_stable_node_chain(stable_node_dup))
1774  VM_BUG_ON(is_stable_node_dup(stable_node_dup))
1776  stable_node等于alloc_stable_node_chain(stable_node_dup, root)
1778  如果非stable_node则返回:NULL
1787  VM_BUG_ON(!is_stable_node_chain(stable_node))
1788  VM_BUG_ON(!is_stable_node_dup(stable_node_dup))
1789  VM_BUG_ON(when listed for migration != & Recently migrated nodes of stable tree, pending proper placement )
1790  删除链表项
1791  DO_NUMA(nid = nid)
1792  stable_node_chain_add_dup(page_node, stable_node)
1793  转到:out
调用者
名称描述
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