Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

maple_tree: add cp_converged() helper

When the maple copy node converges into a single entry, then certain
operations can stop ascending the tree.

This is used more later.

Link: https://lkml.kernel.org/r/20260130205935.2559335-26-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Andrew Ballance <andrewjballance@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christian Kujau <lists@nerdbynature.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Liam R. Howlett and committed by
Andrew Morton
11e7f22f 0abff208

+11 -3
+11 -3
lib/maple_tree.c
··· 3493 3493 return true; 3494 3494 } 3495 3495 3496 + static inline bool cp_converged(struct maple_copy *cp, struct ma_state *mas, 3497 + struct ma_state *sib) 3498 + { 3499 + if (cp->d_count != 1 || sib->end) 3500 + return false; 3501 + 3502 + cp->dst[0].node->parent = ma_parent_ptr(mas_mn(mas)->parent); 3503 + return true; 3504 + } 3505 + 3496 3506 /* 3497 3507 * spanning_ascend() - See if a spanning store operation has to keep walking up 3498 3508 * the tree ··· 3585 3575 if (cp_is_new_root(cp, mas)) 3586 3576 return false; 3587 3577 3588 - if (cp->d_count == 1 && !sib->end) { 3589 - cp->dst[0].node->parent = ma_parent_ptr(mas_mn(mas)->parent); 3578 + if (cp_converged(cp, mas, sib)) 3590 3579 return false; 3591 - } 3592 3580 3593 3581 cp->height++; 3594 3582 copy_tree_location(parent, mas);