Lines Matching refs:dup
339 static __always_inline bool is_stable_node_dup(struct ksm_stable_node *dup) in is_stable_node_dup() argument
341 return dup->head == STABLE_NODE_DUP_HEAD; in is_stable_node_dup()
344 static inline void stable_node_chain_add_dup(struct ksm_stable_node *dup, in stable_node_chain_add_dup() argument
347 VM_BUG_ON(is_stable_node_dup(dup)); in stable_node_chain_add_dup()
348 dup->head = STABLE_NODE_DUP_HEAD; in stable_node_chain_add_dup()
350 hlist_add_head(&dup->hlist_dup, &chain->hlist); in stable_node_chain_add_dup()
354 static inline void __stable_node_dup_del(struct ksm_stable_node *dup) in __stable_node_dup_del() argument
356 VM_BUG_ON(!is_stable_node_dup(dup)); in __stable_node_dup_del()
357 hlist_del(&dup->hlist_dup); in __stable_node_dup_del()
361 static inline void stable_node_dup_del(struct ksm_stable_node *dup) in stable_node_dup_del() argument
363 VM_BUG_ON(is_stable_node_chain(dup)); in stable_node_dup_del()
364 if (is_stable_node_dup(dup)) in stable_node_dup_del()
365 __stable_node_dup_del(dup); in stable_node_dup_del()
367 rb_erase(&dup->node, root_stable_tree + NUMA(dup->nid)); in stable_node_dup_del()
369 dup->head = NULL; in stable_node_dup_del()
559 static struct ksm_stable_node *alloc_stable_node_chain(struct ksm_stable_node *dup, in alloc_stable_node_chain() argument
563 VM_BUG_ON(is_stable_node_chain(dup)); in alloc_stable_node_chain()
578 rb_replace_node(&dup->node, &chain->node, root); in alloc_stable_node_chain()
587 stable_node_chain_add_dup(dup, chain); in alloc_stable_node_chain()
895 struct ksm_stable_node *dup; in remove_stable_node_chain() local
906 hlist_for_each_entry_safe(dup, hlist_safe, in remove_stable_node_chain()
908 VM_BUG_ON(!is_stable_node_dup(dup)); in remove_stable_node_chain()
909 if (remove_stable_node(dup)) in remove_stable_node_chain()
1353 struct ksm_stable_node *dup, *found = NULL, *stable_node = *_stable_node; in stable_node_dup() local
1367 hlist_for_each_entry_safe(dup, hlist_safe, in stable_node_dup()
1380 _tree_page = get_ksm_page(dup, GET_KSM_PAGE_NOLOCK); in stable_node_dup()
1384 if (is_page_sharing_candidate(dup)) { in stable_node_dup()
1386 dup->rmap_hlist_len > found_rmap_hlist_len) { in stable_node_dup()
1389 found = dup; in stable_node_dup()
2745 struct ksm_stable_node *dup; in stable_node_chain_remove_range() local
2754 hlist_for_each_entry_safe(dup, hlist_safe, in stable_node_chain_remove_range()
2756 VM_BUG_ON(!is_stable_node_dup(dup)); in stable_node_chain_remove_range()
2757 stable_node_dup_remove_range(dup, start_pfn, end_pfn); in stable_node_chain_remove_range()