raw_atomic64_inc_and_test(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic64_inc_and_test β€” Kernel API Manual ✨

okay so bestie, welcome to the glow-up era of atomic math πŸ’– this is the page for raw_atomic64_inc_and_test, straight out of the Kernel API Manual (yes that's the actual manual name, we don't make the rules, we just slay within them πŸŽ€).


🌸 NAME 🌸

raw_atomic64_inc_and_test β€” atomic increment and then check if it landed on zero, with full ordering bc we're not messy πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

bool raw_atomic64_inc_and_test (atomic64_t *v );

✨ ARGUMENTS ✨

  • v β€” pointer to atomic64_t. that's it, that's the whole argument list, she's low maintenance πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

So here's the tea: it atomically updates v to (v + 1) with full ordering πŸ’―. like, the increment and the memory ordering are a package deal, no splitting them up, no cap.

Also it's safe to use in noinstr code 🫢 β€” but if you're not in noinstr land, please prefer atomic64_inc_and_test instead, that's the polite thing to do ngl.

fr fr remember: noinstr-safe is the special power here. everywhere else, use atomic64_inc_and_test. πŸ’€ don't make it weird.

⭐ RETURN ⭐

  • true β€” if the resulting value of v is zero πŸŽ‰
  • false β€” otherwise πŸ™ˆ

🌈 SEE ALSO 🌈

okay this is the part where the page just keeps going and going, and honestly? iconic. every single friend in the atomic extended universe is here πŸ’œ so grab a snack πŸ“:

the raw_atomic_* girlies (32-bit era):

the raw_atomic64_* main characters (the 64-bit fam, she ate):


🧚 WHERE SHE LIVES 🧚

the kernel file is ./include/linux/atomic β€” that's the source, bestie 🫢 the page is dated October 2026, and the manual is Kernel API Manual. mwah, thanks for reading, go increment something responsibly πŸ’œπŸ‘‘βœ¨

πŸ“¦ where this page comes from