raw_atomic64_inc_return(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ raw_atomic64_inc_return β€” Kernel API Manual, section 9 ✨

omg hi bestie πŸ’– okay so you found the page for raw_atomic64_inc_return(9) β€” yes it's a whole section 9 manual page, from the Kernel API Manual, and yes it's as iconic as it sounds. Let's get into it πŸŽ€


πŸ’« NAME πŸ’«

raw_atomic64_inc_return β€” an atomic increment, but with full ordering πŸ”₯ like it's not just adding one, it's adding one and making sure the universe agrees on the order it happened. main character energy fr fr.


🌸 SYNOPSIS 🌸

s64 raw_atomic64_inc_return (atomic64_t *v );

so you hand it one thing and it hands you back an s64. that's the whole vibe check πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • v β€” pointer to atomic64_t. yes bestie, a pointer. it wants the address of your 64-bit atomic, not a copy, not a vibe, the actual address πŸ’…

🧚 DESCRIPTION 🧚

okay so, raw_atomic64_inc_return atomically updates v to (v + 1) β€” and it does it with full ordering. atomically means nobody can catch it mid-increment and be like "wait what was it before", no cap 😭

It's safe to use in noinstr code, which is a whole special little zone. But elsewhere? prefer atomic64_inc_return β€” the page literally says so, and we listen to the page πŸ™ˆ

so like β€” noinstr code, yes, go off πŸ‘‘. everywhere else, use the non-raw one. iykyk.


⭐ RETURN ⭐

the updated value of v β€” meaning the value after the + 1, not the old one. so if v was 41, you get 42. iconic. ate. no notes πŸ’€βœ¨


🌈 SEE ALSO 🌈

okay this is the part where the page just dumps its entire friend group on you, and honestly? slay. every single one of these is real and here it is, nobody gets left out 🫢

first up, the actual kernel file it lives in:

  • ./include/linux/atomic/atomic-arch-fallback.h

then the whole 32-bit-ish crew, in the order the page lists them:

and now the 64-bit side of the family, because this page is raw_atomic64_* and it has so many siblings πŸ’œ:

πŸ’€ quick note bestie: notice raw_atomic64_inc_return(9) itself is not in that list β€” that's you, you're the page πŸ’…

and that's the whole page!! sourced from ./include/linux/atomic, dated October 2026 β€” go forth and increment responsibly, bestie πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from