write_seqcount_begin(9)
π write_seqcount_begin(9) π
okay so bestie, welcome to the kernel API manual β this one's a (9) page, and it's about write_seqcount_begin. it lives at ./include/linux and it's dated October 2026, so likeβ¦ future girl math but make it concurrency π°οΈβ¨
πΈ NAME πΈ
write_seqcount_begin β start a seqcount_t write side critical section. that's it. that's the whole vibe check. you're opening the writer's door π
β¨ SYNOPSIS β¨
write_seqcount_begin (s );
literally just hand it s and go, no cap π«Ά
π ARGUMENTS π
sβ pointer to aseqcount_t, or honestly any of theseqcount_LOCKNAME_tvariants π (yes queen, the whole little family is welcome)
π¦ CONTEXT π¦
okay this part is the important part, so like, pay attention bestie π sequence counter write side sections must be serialized and non-preemptible. that's not a suggestion, that's the law π
preemption gets automatically disabled if and only if the seqcount write serialization lock is associated and preemptible. if and only if!! conditional queen π
and if readers can be invoked from hardirq or softirq context? then interrupts or bottom halves must be respectively disabled. respectively!! keep that straight π
don't skip the context rules, i'm literally begging β getting this wrong is giving undefined behaviour energy and nobody wants that π
π₯ SEE ALSO π₯
kernel file ./include/linux/seqlock.h and the whole entire 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_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_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)
like, the whole friend group showed up to the function π iconic turnout, honestly π
okay that's the page!! mwah π this has been write_seqcount_begin(9) from the kernel API manual, sourced from ./include/linux and dated October 2026 β go forth and serialize your write side sections, bestie, i believe in you π§π
π¦ 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