Lines Matching refs:dup

340 static __always_inline bool is_stable_node_dup(struct ksm_stable_node *dup)  in is_stable_node_dup()  argument
342 return dup->head == STABLE_NODE_DUP_HEAD; in is_stable_node_dup()
345 static inline void stable_node_chain_add_dup(struct ksm_stable_node *dup, in stable_node_chain_add_dup() argument
348 VM_BUG_ON(is_stable_node_dup(dup)); in stable_node_chain_add_dup()
349 dup->head = STABLE_NODE_DUP_HEAD; in stable_node_chain_add_dup()
351 hlist_add_head(&dup->hlist_dup, &chain->hlist); in stable_node_chain_add_dup()
355 static inline void __stable_node_dup_del(struct ksm_stable_node *dup) in __stable_node_dup_del() argument
357 VM_BUG_ON(!is_stable_node_dup(dup)); in __stable_node_dup_del()
358 hlist_del(&dup->hlist_dup); in __stable_node_dup_del()
362 static inline void stable_node_dup_del(struct ksm_stable_node *dup) in stable_node_dup_del() argument
364 VM_BUG_ON(is_stable_node_chain(dup)); in stable_node_dup_del()
365 if (is_stable_node_dup(dup)) in stable_node_dup_del()
366 __stable_node_dup_del(dup); in stable_node_dup_del()
368 rb_erase(&dup->node, root_stable_tree + NUMA(dup->nid)); in stable_node_dup_del()
370 dup->head = NULL; in stable_node_dup_del()
587 static struct ksm_stable_node *alloc_stable_node_chain(struct ksm_stable_node *dup, in alloc_stable_node_chain() argument
591 VM_BUG_ON(is_stable_node_chain(dup)); in alloc_stable_node_chain()
606 rb_replace_node(&dup->node, &chain->node, root); in alloc_stable_node_chain()
615 stable_node_chain_add_dup(dup, chain); in alloc_stable_node_chain()
923 struct ksm_stable_node *dup; in remove_stable_node_chain() local
934 hlist_for_each_entry_safe(dup, hlist_safe, in remove_stable_node_chain()
936 VM_BUG_ON(!is_stable_node_dup(dup)); in remove_stable_node_chain()
937 if (remove_stable_node(dup)) in remove_stable_node_chain()
1379 struct ksm_stable_node *dup, *found = NULL, *stable_node = *_stable_node; in stable_node_dup() local
1393 hlist_for_each_entry_safe(dup, hlist_safe, in stable_node_dup()
1406 _tree_page = get_ksm_page(dup, GET_KSM_PAGE_NOLOCK); in stable_node_dup()
1410 if (is_page_sharing_candidate(dup)) { in stable_node_dup()
1412 dup->rmap_hlist_len > found_rmap_hlist_len) { in stable_node_dup()
1415 found = dup; in stable_node_dup()
2774 struct ksm_stable_node *dup; in stable_node_chain_remove_range() local
2783 hlist_for_each_entry_safe(dup, hlist_safe, in stable_node_chain_remove_range()
2785 VM_BUG_ON(!is_stable_node_dup(dup)); in stable_node_chain_remove_range()
2786 stable_node_dup_remove_range(dup, start_pfn, end_pfn); in stable_node_chain_remove_range()