write_seqlock(9)
π write_seqlock(9) β a Kernel API Manual moment
okay so first of all, bestie, this page lives in the Kernel API Manual and it's about write_seqlock. yes the name is a mouthful, no we're not skipping it, it's iconic. β¨
πΈ NAME
write_seqlock β start a seqlock_t write side critical section
like, you're opening the write side of the party. main character energy only.
π SYNOPSIS
void write_seqlock (seqlock_t *sl );
π ARGUMENTS
slβ pointer toseqlock_t. that's it. that's the whole argument list. she's low maintenance.
β¨ DESCRIPTION
write_seqlock opens a write side critical section for the given seqlock_t. periodt.
and like, it also implicitly acquires the spinlock_t embedded inside that sequential lock β so it's doing two things at once, multi-tasking queen π«Ά. because of that, all seqlock_t write side sections are automatically serialized and non-preemptible. no cap, that's just how she runs.
π¦ CONTEXT
okay this is the important bit, so listen up π β if the seqlock_t read section, or other write side critical sections, can be invoked from hardirq or softirq contexts, use the _irqsave or _bh variants of this function instead.
like literally do not rawdog the plain version in irq context, bestie, that's not the vibe π
π SEE ALSO
Kernel file ./include/linux/seqlock.h and honestly her whole extended friend group:
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_sequnlock(9)write_seqlock_bh(9)write_sequnlock_bh(9)write_seqlock_irq(9)write_sequnlock_irq(9)write_seqlock_irqsave(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)
k bye bestie, this page came from ./include/linux and it's dated October 2026, and yes we're still calling it write_seqlock(9) because consistency is cute π
β¨
π¦ 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