raw_atomic_long_inc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 raw_atomic_long_inc β€” the manual, but make it make sense 🌸

okay so bestie, this page lives in the Kernel API Manual and honestly it's a short one, but it's lowkey iconic. we're doing one (1) thing here: bumping an atomic_long_t up by one, atomically. that's the whole vibe.


✨ NAME ✨

raw_atomic_long_inc β€” an atomic increment, but make it relaxed ordering πŸ’…


✨ SYNOPSIS ✨

void raw_atomic_long_inc (atomic_long_t *v );

✨ ARGUMENTS ✨

  • v β€” pointer to atomic_long_t. that's it. that's the argument. she's a pointer and she knows it πŸŽ€

✨ DESCRIPTION ✨

So here's the tea, bestie: it atomically updates v to (v + 1) with relaxed ordering. atomically means nobody's gonna catch it mid-bump, fr fr β€” the whole thing happens as one indivisible little moment. and relaxed ordering means we're not doing any extra memory-barrier choreography, we're just out here vibing 😌✨

It's safe to use in noinstr code β€” highkey important, that's the whole reason this raw version exists. but everywhere else? prefer atomic_long_inc. like, atomic_long_inc is the main character for general use; this one is the backstage-pass version for the special noinstr situations 🎟️

ngl, if you're not in noinstr code, just use atomic_long_inc. it's giving "use the normal one" energy. this page said it itself, so don't come for me πŸ’€

✨ RETURN ✨

Nothing. Not zero, not void-as-a-joke β€” genuinely nothing. she does her little increment and leaves. no receipts, no notes, no return value 🫢


✨ SEE ALSO ✨

the whole atomic-long family reunion is right here β€” every single one of them, and yes I'm listing every single one, we do not skip entries in this house πŸ‘‘

first up, the kernel file where all this magic lives:

  • Kernel file ./include/linux/atomic/atomic-long.h πŸ¦‹

and now the extended fam:


okay that's the whole page, you ate that πŸ’– this lil artifact comes from ./include/linux/atomic (yes, that's the source path, she's lowkey humble about it) and the version stamps her as October 2026 β€” so go forth, increment responsibly, and remember: atomic_long_inc for the everyday, raw_atomic_long_inc when you're in noinstr and you mean it. periodt. βœ¨πŸŽ€πŸ’œ

πŸ“¦ where this page comes from