Lines Matching defs:chain

149  * @hlist_dup: linked into the stable_node->hlist with a stable_node chain
344 static __always_inline bool is_stable_node_chain(struct ksm_stable_node *chain)
346 return chain->rmap_hlist_len == STABLE_NODE_CHAIN;
355 struct ksm_stable_node *chain)
359 VM_BUG_ON(!is_stable_node_chain(chain));
360 hlist_add_head(&dup->hlist_dup, &chain->hlist);
630 struct ksm_stable_node *chain = alloc_stable_node();
632 if (likely(chain)) {
633 INIT_HLIST_HEAD(&chain->hlist);
634 chain->chain_prune_time = jiffies;
635 chain->rmap_hlist_len = STABLE_NODE_CHAIN;
637 chain->nid = NUMA_NO_NODE; /* debug */
642 * Put the stable node chain in the first dimension of
646 rb_replace_node(&dup->node, &chain->node, root);
651 * dup stable_nodes in the chain->hlist point to pages
655 stable_node_chain_add_dup(dup, chain);
657 return chain;
660 static inline void free_stable_node_chain(struct ksm_stable_node *chain,
663 rb_erase(&chain->node, root);
664 free_stable_node(chain);
1490 * nr is counting all dups in the chain only if
1506 * deduplication limit so drop the chain.
1515 * to be equal to stable_node_dup if the chain
1532 * the chain, put it there so next search will
1540 * the position of the found dup in the chain,
1541 * but the total number of dups in the chain.
1571 * stable_node_dup if the chain is collapsed (in which case
1572 * *_stable_node will be equal to *_stable_node_dup like if the chain
1609 static __always_inline struct page *chain(struct ksm_stable_node **s_n_d,
1666 * order to collapse the stable_node chain if a single
1671 * stable_node_dup like if the chain never existed.
1676 * this stable_node chain, or this chain was
1687 * this stable_node chain to let the tree walk
1689 * stable_node dups in a stable_node chain
1726 * without adding it to the chain.
1734 * If the stable_node is a chain and
1794 * If stable_node was a chain and chain_prune collapsed it,
1796 * stable_node. A collapse of the chain is indistinguishable
1797 * from the case there was no chain in the stable
1798 * rbtree. Otherwise stable_node is the chain and
1804 /* there is no chain */
1845 * If stable_node was a chain and chain_prune collapsed it,
1847 * stable_node. A collapse of the chain is indistinguishable
1848 * from the case there was no chain in the stable
1849 * rbtree. Otherwise stable_node is the chain and
1854 /* chain is missing so create it */
1862 * migrated to the stable_node chain
1905 tree_page = chain(&stable_node_dup, stable_node, root);
1909 * this stable_node chain, or this chain was
1920 * this stable_node chain to let the tree walk
1922 * stable_node dups in a stable_node chain
1973 /* chain is missing so create it */