local_trylock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so this is local_trylock(9) from the Kernel API Manual, and the whole point is: local_trylock β€” try to acquire a per CPU local lock πŸ’…


✨ SYNOPSIS ✨

the signature, literally:

local_trylock (lock );

πŸŽ€ ARGUMENTS πŸŽ€

  • lock β€” the lock variable. that's the arg, bestie 🫢

πŸ’« DESCRIPTION πŸ’«

okay so this function can be used in any context, such as NMI or HARDIRQ. iconic.

but due to locking constrains it will _always_ fail to acquire the lock in NMI or HARDIRQ context on PREEMPT_RT. no cap, that's the caveat 😭

πŸ¦‹ SEE ALSO πŸ¦‹

the squad, plus the kernel file:


mwah πŸ’‹ β€” source/version: ./include/linux; date: October 2026; page: local_trylock(9). periodt 🌈

πŸ“¦ where this page comes from