raw_atomic_long_sub(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… raw_atomic_long_sub(9) πŸ’…

okay so you're in the Kernel API Manual bestie, and today's main character is raw_atomic_long_sub β€” the raw, relaxed-ordering girly who subtracts things atomically. she's lowkey iconic and you're gonna learn her. πŸŽ€


🌸 NAME 🌸

raw_atomic_long_sub β€” atomic subtract with relaxed ordering ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

void raw_atomic_long_sub (long i , atomic_long_t *v );

πŸ’– ARGUMENTS πŸ’–

  • i β€” the long value you're subtracting. that's the amount getting taken away, periodt. 🫢
  • v β€” pointer to the atomic_long_t. this is the vibe you're operating on, no cap. πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

so like, she atomically updates v to (v - i) with relaxed ordering. literally the whole flex. πŸ”₯

and the important bit: it's safe to use in noinstr code β€” that's her special talent πŸ’« β€” but prefer atomic_long_sub everywhere else. like, raw_ is for the noinstriest of occasions, iykyk. ngl don't just raw-dog your atomics for fun, bestie. πŸ™ˆ


⭐ RETURN ⭐

Nothing. she gives you vibes, not values. πŸ’€ (if you want the value back, that's a different function, bestie β€” go check the list below πŸ‘€)


🌈 SEE ALSO 🌈

Kernel file ./include/linux/atomic/atomic-long.h

the whole extended friend group, in order, no gatekeeping: 🫢


ok that's a lot of names but every single one of them ate, and they're all siblings of this function so like. show respect. πŸ‘‘

that's the whole page bestie, go atomically subtract somethingresponsibly πŸ’œ


and that's a wrap from ./include/linux/atomic, dated October 2026 β€” catch you in the next manpage, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from