Lines Matching defs:dup
86 * write protected memory content, but each "dup" corresponds to a
349 static __always_inline bool is_stable_node_dup(struct ksm_stable_node *dup)
351 return dup->head == STABLE_NODE_DUP_HEAD;
354 static inline void stable_node_chain_add_dup(struct ksm_stable_node *dup,
357 VM_BUG_ON(is_stable_node_dup(dup));
358 dup->head = STABLE_NODE_DUP_HEAD;
360 hlist_add_head(&dup->hlist_dup, &chain->hlist);
364 static inline void __stable_node_dup_del(struct ksm_stable_node *dup)
366 VM_BUG_ON(!is_stable_node_dup(dup));
367 hlist_del(&dup->hlist_dup);
371 static inline void stable_node_dup_del(struct ksm_stable_node *dup)
373 VM_BUG_ON(is_stable_node_chain(dup));
374 if (is_stable_node_dup(dup))
375 __stable_node_dup_del(dup);
377 rb_erase(&dup->node, root_stable_tree + NUMA(dup->nid));
379 dup->head = NULL;
627 static struct ksm_stable_node *alloc_stable_node_chain(struct ksm_stable_node *dup,
631 VM_BUG_ON(is_stable_node_chain(dup));
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);
878 * page and upping mmap_lock. Nor does it fit with the way we skip dup'ing
966 struct ksm_stable_node *dup;
977 hlist_for_each_entry_safe(dup, hlist_safe,
979 VM_BUG_ON(!is_stable_node_dup(dup));
980 if (remove_stable_node(dup))
1439 struct ksm_stable_node *dup, *found = NULL, *stable_node = *_stable_node;
1453 hlist_for_each_entry_safe(dup, hlist_safe,
1462 * (that's why we do a _safe walk). The "dup"
1466 _tree_page = get_ksm_page(dup, GET_KSM_PAGE_NOLOCK);
1470 if (is_page_sharing_candidate(dup)) {
1472 dup->rmap_hlist_len > found_rmap_hlist_len) {
1475 found = dup;
1479 /* skip put_page for found dup */
1529 * If the found stable_node dup can accept one
1540 * the position of the found dup in the chain,
1667 * stable_node dup was found in it). In such case the
1724 * into a stable node dup. If the mapcount is
1799 * stable_node_dup is the dup to replace.
1850 * stable_node_dup is the dup to replace.
1861 * Add this stable_node dup that was
3010 struct ksm_stable_node *dup;
3019 hlist_for_each_entry_safe(dup, hlist_safe,
3021 VM_BUG_ON(!is_stable_node_dup(dup));
3022 stable_node_dup_remove_range(dup, start_pfn, end_pfn);