Function report |
Source Code:mm\ksm.c |
Create Date:2022-07-28 15:41:17 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:stable_tree_insert - insert stable tree node pointing to new ksm page* into the stable tree.* This function returns the stable tree node just allocated on success,* NULL otherwise.
Proto:static struct stable_node *stable_tree_insert(struct page *kpage)
Type:struct stable_node
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct page * | kpage |
| 1811 | bool need_chain = false |
| 1813 | kpfn = page_to_pfn(kpage) |
| 1815 | root = root_stable_tree + nid |
| 1816 | again : |
| 1817 | parent = NULL |
| 1824 | cond_resched() |
| 1825 | stable_node = rb_entry( * new, structstable_node, node) |
| 1826 | stable_node_any = NULL |
| 1827 | tree_page = chain( & stable_node_dup, stable_node, root) |
| 1828 | If Not stable_node_dup Then |
| 1836 | If Not stable_node_any Then |
| 1838 | Go to again |
| 1852 | VM_BUG_ON(!stable_node_dup ^ !!stable_node_any) |
| 1853 | If Not tree_page Then |
| 1863 | Go to again |
| 1866 | ret = memcmp_pages(kpage, tree_page) |
| 1874 | Else |
| 1875 | need_chain = true |
| 1876 | Break |
| 1880 | stable_node_dup = alloc_stable_node() |
| 1881 | If Not stable_node_dup Then Return NULL |
| 1884 | INIT_HLIST_HEAD( & hlist) |
| 1887 | rmap_hlist_len = 0 |
| 1889 | If Not need_chain Then |
| 1890 | rb_link_node( & when node of stable tree , parent, new) |
| 1891 | rb_insert_color( & when node of stable tree , root) |
| 1892 | Else |
| 1893 | If Not is_stable_node_chain(stable_node) Then |
| 1894 | orig = stable_node |
| 1896 | stable_node = alloc_stable_node_chain(orig, root) |
| 1897 | If Not stable_node Then |
| 1899 | Return NULL |
| 1905 | Return stable_node_dup |
| Name | Describe |
|---|---|
| cmp_and_merge_page | mp_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 |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |