read_seqcount_latch_retry(9)
π read_seqcount_latch_retry β a Kernel API Manual moment
okay so bestie, welcome to the Kernel API Manual, and today's main character is read_seqcount_latch_retry(9) β the little function that tells you whether your read section needs a do-over. yes, THE vibe check of the latch world. π
β¨ NAME β¨
read_seqcount_latch_retry β end a seqcount_latch_t read section π«Ά
like, you opened a read section, you did your lil reading, and now you're closing it out and asking the kernel "was that valid tho?" and it answers you. iconic behaviour honestly.
πΈ SYNOPSIS πΈ
int read_seqcount_latch_retry (const seqcount_latch_t *s , unsigned start );
π¦ ARGUMENTS π¦
sβ Pointer toseqcount_latch_t. yes it's a pointer, yes it's const, no you do not get to mess with it πstartβ count, fromread_seqcount_latch. this is the lil souvenir you grabbed on the way in so you can compare it on the way out. iykyk.
β RETURN β
true if a read section retry is required, else false.
that's it, that's the whole verdict. true = bestie the data moved, run it back π. false = you're good, ship it π₯.
π SEE ALSO π
so many siblings, it's giving big family energy. the whole squad lives in the Kernel file ./include/linux/seqlock.h, and here's literally every single one of them π
- the seqcount core girlies β
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) - write-side behaviour β
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) - the latch squad (our people π«Ά) β
SEQCNT_LATCH_ZERO(9),seqcount_latch_init(9),raw_read_seqcount_latch(9),read_seqcount_latch(9),raw_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 basics β
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) - excl reader crew β
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) - begin-or-lock besties β
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)
ngl bestie, this page is tiny but it's doing so much. always check your retry, always respect the sequence count, and never ever pretend a retry wasn't needed. the kernel will notice π
π that's the whole page! brought to you straight from ./include/linux, dated October 2026 β no cap, that's the source and version, so you know it's legit. mwah, go read your latches responsibly π§β¨π
π¦ 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