Lines Matching refs:dup
343 static __always_inline bool is_stable_node_dup(struct stable_node *dup) in is_stable_node_dup() argument
345 return dup->head == STABLE_NODE_DUP_HEAD; in is_stable_node_dup()
348 static inline void stable_node_chain_add_dup(struct stable_node *dup, in stable_node_chain_add_dup() argument
351 VM_BUG_ON(is_stable_node_dup(dup)); in stable_node_chain_add_dup()
352 dup->head = STABLE_NODE_DUP_HEAD; in stable_node_chain_add_dup()
354 hlist_add_head(&dup->hlist_dup, &chain->hlist); in stable_node_chain_add_dup()
358 static inline void __stable_node_dup_del(struct stable_node *dup) in __stable_node_dup_del() argument
360 VM_BUG_ON(!is_stable_node_dup(dup)); in __stable_node_dup_del()
361 hlist_del(&dup->hlist_dup); in __stable_node_dup_del()
365 static inline void stable_node_dup_del(struct stable_node *dup) in stable_node_dup_del() argument
367 VM_BUG_ON(is_stable_node_chain(dup)); in stable_node_dup_del()
368 if (is_stable_node_dup(dup)) in stable_node_dup_del()
369 __stable_node_dup_del(dup); in stable_node_dup_del()
371 rb_erase(&dup->node, root_stable_tree + NUMA(dup->nid)); in stable_node_dup_del()
373 dup->head = NULL; in stable_node_dup_del()
590 static struct stable_node *alloc_stable_node_chain(struct stable_node *dup, in alloc_stable_node_chain() argument
594 VM_BUG_ON(is_stable_node_chain(dup)); in alloc_stable_node_chain()
609 rb_replace_node(&dup->node, &chain->node, root); in alloc_stable_node_chain()
618 stable_node_chain_add_dup(dup, chain); in alloc_stable_node_chain()
901 struct stable_node *dup; in remove_stable_node_chain() local
912 hlist_for_each_entry_safe(dup, hlist_safe, in remove_stable_node_chain()
914 VM_BUG_ON(!is_stable_node_dup(dup)); in remove_stable_node_chain()
915 if (remove_stable_node(dup)) in remove_stable_node_chain()
1363 struct stable_node *dup, *found = NULL, *stable_node = *_stable_node; in stable_node_dup() local
1377 hlist_for_each_entry_safe(dup, hlist_safe, in stable_node_dup()
1390 _tree_page = get_ksm_page(dup, false); in stable_node_dup()
1394 if (is_page_sharing_candidate(dup)) { in stable_node_dup()
1396 dup->rmap_hlist_len > found_rmap_hlist_len) { in stable_node_dup()
1399 found = dup; in stable_node_dup()
2700 struct stable_node *dup; in stable_node_chain_remove_range() local
2709 hlist_for_each_entry_safe(dup, hlist_safe, in stable_node_chain_remove_range()
2711 VM_BUG_ON(!is_stable_node_dup(dup)); in stable_node_chain_remove_range()
2712 stable_node_dup_remove_range(dup, start_pfn, end_pfn); in stable_node_chain_remove_range()