write_seqlock_irqsave(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… write_seqlock_irqsave β€” Kernel API Manual

okay so bestie, you found your way to write_seqlock_irqsave(9) and honestly? iconic of you. this is the kernel API manual page, and we're gonna get you through it together, no cap. ✨


🌸 NAME 🌸

write_seqlock_irqsave β€” start a non-interruptible seqlock_t write section πŸŽ€

like, you're grabbing the write side of a seqlock AND saving your interrupt state in one move. main character energy fr.


✨ SYNOPSIS ✨

write_seqlock_irqsave (lock , flags );

that's it. two args. she's simple but she's doing a lot of work behind the scenes, iykyk. πŸ’…


🫢 ARGUMENTS 🫢

  • lock β€” Pointer to seqlock_t. this is the seqlock you're about to snatch up for writing πŸ‘‘
  • flags β€” Stack-allocated storage for saving caller's local interrupt state, to be passed to write_sequnlock_irqrestore. so like... you keep the little flags somewhere on your own stack, and later you hand them right back to write_sequnlock_irqrestore so everything gets restored properly. don't lose them, bestie 😭

πŸ’– DESCRIPTION πŸ’–

this is the _irqsave variant of write_seqlock. ✨

⚠️ okay important part, do NOT skip: use it only if the read side section, or other write sections, can be invoked from hardirq context.

like literally only then. if hardirq context can't touch it, this is not the snack you're looking for. the whole point of the _irqsave flavor is that interrupt-state-saving thing, and if you don't need it you're just doing extra work for the vibes. πŸ™ˆ


πŸ¦‹ SEE ALSO πŸ¦‹

the extended friend group πŸ’œ β€” all of these live in the Kernel file ./include/linux/seqlock.h:

that's the whole group chat, go say hi 🫢


and that's the page, bestie!! 🌈 this one came out of ./include/linux, dated October 2026, and it's filed under write_seqlock_irqsave(9) β€” go forth and lock responsibly, mwah πŸ’‹β­

πŸ“¦ where this page comes from