mas_pause(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Hiii bestie! Welcome to the mas_pause(9) page from the Kernel API Manual β€” we're in kernel-land with maple trees, and this one is literally about pausing a walk so you can drop the lock. 🧚✨

🌸 NAME 🌸

mas_pause β€” pause a mas_find/mas_for_each to drop the lock. Periodt. πŸ’…

✨ SYNOPSIS ✨

void mas_pause (struct ma_state *mas );

πŸŽ€ ARGUMENTS πŸŽ€

  • mas β€” the maple state to pause, bestie. It's your struct ma_state *mas.

πŸ’… DESCRIPTION πŸ’…

Okay so picture this: some users need to pause a walk and drop the lock they're holding in order to yield to a higher priority thread or carry out an operation on an entry. 🫢 Those users should call this function before they drop the lock. No cap.

It resets the mas to be suitable for the next iteration of the loop after the user has reacquired the lock. So you drop the lock, do your little side quest, reacquire, and the loop is ready for its next iteration. ✨

If most entries found during a walk require you to call mas_pause, the mt_for_each iterator may be more appropriate. That's the whole vibe check. πŸ¦‹

Bestie note: call mas_pause before dropping the lock, and remember it resets mas for the next loop iteration after you've reacquired the lock. πŸ’–

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./lib/maple_tree.c, plus the whole reference squad: mas_prealloc_calc(9), mas_wr_preallocate(9), mas_insert(9), mas_alloc_cyclic(9), mas_walk(9), mte_dead_walk(9), mt_free_walk(9), mas_store(9), mas_store_gfp(9), mas_store_prealloc(9), mas_preallocate(9), mas_next(9), mas_next_range(9), mt_next(9), mas_prev(9), mas_prev_range(9), mt_prev(9), mas_find_setup(9), mas_find(9), mas_find_range(9), mas_find_rev_setup(9), mas_find_rev(9), mas_find_range_rev(9), mas_erase(9), mas_nomem(9), mas_nomem_nofail(9), mtree_load(9), mtree_store_range(9), mtree_store(9), mtree_insert_range(9), mtree_insert(9), mtree_alloc_cyclic(9), mtree_erase(9), __mt_dup(9), mtree_dup(9), __mt_destroy(9), mtree_destroy(9), mt_find(9), mt_find_after(9).


xoxo, from source ./lib, dated October 2026, page mas_pause(9) πŸ’…βœ¨

πŸ“¦ where this page comes from