write_seqlock_irqsave(9)
π 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 toseqlock_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 towrite_sequnlock_irqrestore. so like... you keep the little flags somewhere on your own stack, and later you hand them right back towrite_sequnlock_irqrestoreso 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:
seqcount_init(9),SEQCNT_ZERO(9)__read_seqcount_begin(9),raw_read_seqcount_begin(9),read_seqcount_begin(9)raw_read_seqcount(9),raw_seqcount_try_begin(9),raw_seqcount_begin(9)__read_seqcount_retry(9),read_seqcount_retry(9)raw_write_seqcount_begin(9),raw_write_seqcount_end(9)write_seqcount_begin_nested(9),write_seqcount_begin(9),write_seqcount_end(9)raw_write_seqcount_barrier(9),write_seqcount_invalidate(9)SEQCNT_LATCH_ZERO(9),seqcount_latch_init(9)raw_read_seqcount_latch(9),read_seqcount_latch(9)raw_read_seqcount_latch_retry(9),read_seqcount_latch_retry(9)raw_write_seqcount_latch(9),write_seqcount_latch_begin(9),write_seqcount_latch(9),write_seqcount_latch_end(9)seqlock_init(9),DEFINE_SEQLOCK(9)read_seqbegin(9),read_seqretry(9)write_seqlock(9),write_sequnlock(9)write_seqlock_bh(9),write_sequnlock_bh(9)write_seqlock_irq(9),write_sequnlock_irq(9),write_sequnlock_irqrestore(9)read_seqlock_excl(9),read_sequnlock_excl(9)read_seqlock_excl_bh(9),read_sequnlock_excl_bh(9)read_seqlock_excl_irq(9),read_sequnlock_excl_irq(9)read_seqlock_excl_irqsave(9),read_sequnlock_excl_irqrestore(9)read_seqbegin_or_lock(9),need_seqretry(9),done_seqretry(9)read_seqbegin_or_lock_irqsave(9),done_seqretry_irqrestore(9)scoped_seqlock_read(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms