Lines Matching refs:dup
349 static __always_inline bool is_stable_node_dup(struct ksm_stable_node *dup) in is_stable_node_dup() argument
351 return dup->head == STABLE_NODE_DUP_HEAD; in is_stable_node_dup()
354 static inline void stable_node_chain_add_dup(struct ksm_stable_node *dup, in stable_node_chain_add_dup() argument
357 VM_BUG_ON(is_stable_node_dup(dup)); in stable_node_chain_add_dup()
358 dup->head = STABLE_NODE_DUP_HEAD; in stable_node_chain_add_dup()
360 hlist_add_head(&dup->hlist_dup, &chain->hlist); in stable_node_chain_add_dup()
364 static inline void __stable_node_dup_del(struct ksm_stable_node *dup) in __stable_node_dup_del() argument
366 VM_BUG_ON(!is_stable_node_dup(dup)); in __stable_node_dup_del()
367 hlist_del(&dup->hlist_dup); in __stable_node_dup_del()
371 static inline void stable_node_dup_del(struct ksm_stable_node *dup) in stable_node_dup_del() argument
373 VM_BUG_ON(is_stable_node_chain(dup)); in stable_node_dup_del()
374 if (is_stable_node_dup(dup)) in stable_node_dup_del()
375 __stable_node_dup_del(dup); in stable_node_dup_del()
377 rb_erase(&dup->node, root_stable_tree + NUMA(dup->nid)); in stable_node_dup_del()
379 dup->head = NULL; in stable_node_dup_del()
627 static struct ksm_stable_node *alloc_stable_node_chain(struct ksm_stable_node *dup, in alloc_stable_node_chain() argument
631 VM_BUG_ON(is_stable_node_chain(dup)); in alloc_stable_node_chain()
646 rb_replace_node(&dup->node, &chain->node, root); in alloc_stable_node_chain()
655 stable_node_chain_add_dup(dup, chain); in alloc_stable_node_chain()
966 struct ksm_stable_node *dup; in remove_stable_node_chain() local
977 hlist_for_each_entry_safe(dup, hlist_safe, in remove_stable_node_chain()
979 VM_BUG_ON(!is_stable_node_dup(dup)); in remove_stable_node_chain()
980 if (remove_stable_node(dup)) in remove_stable_node_chain()
1438 struct ksm_stable_node *dup, *found = NULL, *stable_node = *_stable_node; in stable_node_dup() local
1452 hlist_for_each_entry_safe(dup, hlist_safe, in stable_node_dup()
1465 _tree_page = get_ksm_page(dup, GET_KSM_PAGE_NOLOCK); in stable_node_dup()
1469 if (is_page_sharing_candidate(dup)) { in stable_node_dup()
1471 dup->rmap_hlist_len > found_rmap_hlist_len) { in stable_node_dup()
1474 found = dup; in stable_node_dup()
3007 struct ksm_stable_node *dup; in stable_node_chain_remove_range() local
3016 hlist_for_each_entry_safe(dup, hlist_safe, in stable_node_chain_remove_range()
3018 VM_BUG_ON(!is_stable_node_dup(dup)); in stable_node_chain_remove_range()
3019 stable_node_dup_remove_range(dup, start_pfn, end_pfn); in stable_node_chain_remove_range()