Lines Matching defs:dup

88  *   write protected memory content, but each "dup" corresponds to a
527 static __always_inline bool is_stable_node_dup(struct ksm_stable_node *dup)
529 return dup->head == STABLE_NODE_DUP_HEAD;
532 static inline void stable_node_chain_add_dup(struct ksm_stable_node *dup,
535 VM_BUG_ON(is_stable_node_dup(dup));
536 dup->head = STABLE_NODE_DUP_HEAD;
538 hlist_add_head(&dup->hlist_dup, &chain->hlist);
542 static inline void __stable_node_dup_del(struct ksm_stable_node *dup)
544 VM_BUG_ON(!is_stable_node_dup(dup));
545 hlist_del(&dup->hlist_dup);
549 static inline void stable_node_dup_del(struct ksm_stable_node *dup)
551 VM_BUG_ON(is_stable_node_chain(dup));
552 if (is_stable_node_dup(dup))
553 __stable_node_dup_del(dup);
555 rb_erase(&dup->node, root_stable_tree + NUMA(dup->nid));
557 dup->head = NULL;
780 static struct ksm_stable_node *alloc_stable_node_chain(struct ksm_stable_node *dup,
784 VM_BUG_ON(is_stable_node_chain(dup));
799 rb_replace_node(&dup->node, &chain->node, root);
804 * dup stable_nodes in the chain->hlist point to pages
808 stable_node_chain_add_dup(dup, chain);
1032 * page and upping mmap_lock. Nor does it fit with the way we skip dup'ing
1121 struct ksm_stable_node *dup;
1132 hlist_for_each_entry_safe(dup, hlist_safe,
1134 VM_BUG_ON(!is_stable_node_dup(dup));
1135 if (remove_stable_node(dup))
1642 struct ksm_stable_node *dup, *found = NULL, *stable_node = *_stable_node;
1655 hlist_for_each_entry_safe(dup, hlist_safe,
1664 * (that's why we do a _safe walk). The "dup"
1668 folio = ksm_get_folio(dup, KSM_GET_FOLIO_NOLOCK);
1672 if (!found || (is_page_sharing_candidate(dup) &&
1674 dup->rmap_hlist_len > found_rmap_hlist_len))) {
1677 found = dup;
1724 * If the found stable_node dup can accept one
1735 * the position of the found dup in the chain,
1938 * stable_node_dup is the dup to replace.
1986 * stable_node_dup is the dup to replace.
1997 * Add this stable_node dup that was
3187 struct ksm_stable_node *dup;
3196 hlist_for_each_entry_safe(dup, hlist_safe,
3198 VM_BUG_ON(!is_stable_node_dup(dup));
3199 stable_node_dup_remove_range(dup, start_pfn, end_pfn);