xor_unlock_is_negative_byte(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

It’s xor_unlock_is_negative_byte, bestie β€” the Kernel API Manual entry with the long name and a very specific little job. In plain terms: XOR a single byte in memory and test if it is negative, for unlock. Yes, that is literally the whole name-vibe. πŸ’…


✨ SYNOPSIS ✨

bool xor_unlock_is_negative_byte (unsigned long mask , volatile unsigned
long *addr );

πŸŽ€ ARGUMENTS πŸŽ€

  • mask β€” change the bits which are set in this mask.
  • addr β€” the address of the word containing the byte to change.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this function changes some of bits 0-6 in the word pointed to by addr. It is atomic and gives release barrier semantics β€” no cap, that part is important. It’s used to optimise some folio operations which are commonly paired with an unlock or end of writeback. Bit 7 is used as PG_waiters to indicate whether anybody is waiting for the unlock. 🫢


πŸ’– RETURN πŸ’–

It returns whether the top bit of the byte is set. Simple as that, periodt. ✨


πŸ‘‘ SEE ALSO πŸ‘‘


Cute sign-off time: source/version is ./include/asm-generic/bitops, dated October 2026, and the page is xor_unlock_is_negative_byte(9). Bye bestie, go be iconic with your bits πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from