read_seqretry(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ read_seqretry β€” like, the Kernel API Manual but make it cute ✨

Okay so bestie, gather round, because we are about to talk about read_seqretry from the Kernel API Manual and it is literally the closing act of a seqlock read. No cap, it's giving "the sequel to read_seqbegin" and I am obsessed. πŸŽ€


🌸 NAME 🌸

read_seqretry β€” okay so this is the function that ends a seqlock_t read side section, periodt. That's the whole vibe. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the signature, and yes you have to type it exactly like this, no edits, no "oops I changed a word":

unsigned read_seqretry (const seqlock_t *sl , unsigned start );

It returns an unsigned, takes a const seqlock_t * and an unsigned start. Iconic little combo, honestly. ⭐


πŸ“ ARGUMENTS πŸ“

  • sl β€” this is a Pointer to seqlock_t. Like, it's the seqlock you're working with. The main character. πŸ‘‘
  • start β€” this is the count, from read_seqbegin. You got this value from read_seqbegin earlier and now you're handing it back. Teamwork, fr fr. 🫢

πŸ’œ DESCRIPTION πŸ’œ

So read_seqretry closes the read side critical section of the given seqlock_t. That's its whole job. It's the "okay I'm done reading, did anything mess with my data while I was in there?" check. 😭

⚠️ Important caveat, bestie: if the critical section was invalid, it must be ignored (and typically retried). Do not use that data. Do not pass go. Do not collect $200. Just ignore it and try again. This is not a drill. πŸ’€

🌈 RETURN 🌈

  • true β€” a read section retry is required. So like, yeah, that read didn't go great, try again.
  • false β€” no retry needed. You're slaying. You can keep the data. ✨

πŸ”₯ SEE ALSO πŸ”₯

Okay this list is long and I am not about to leave anyone out because every single one of these is part of the seqlock family and they all ate. πŸ’–

Kernel file ./include/linux/seqlock.h β€” and then the whole squad, exactly as listed:

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), 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 I said: the whole squad. No one left behind. 🧚


🫢 Cute little sign-off: this page lives in ./include/linux and is dated October 2026, straight from the Kernel API Manual. Stay safe, close your read sections, and remember: if it's invalid, ignore it and retry. Bye bestie! πŸ’œπŸŒΈ
πŸ“¦ where this page comes from