STRUCT PERSISTENT_RAM_BUFFER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct persistent_ram_buffer β€” the persistent circular RAM buffer, bestie πŸ’«

So there's this struct, right, and it's literally a ring buffer that lives in RAM that persists across reboots. Iconic behaviour, no cap.


🌸 SYNOPSIS 🌸

struct persistent_ram_buffer {
    uint32_t sig;
    atomic_t start;
    atomic_t size;
    uint8_t data[];
};

That's the whole vibe. Four members, one of them is a flexible array, she's giving main character energy πŸŽ€


πŸŽ€ Members πŸŽ€

Okay so let's meet the members one by one, they all ate:

  • sig β€” the signature that says "yes queen, this is a header" (it's PERSISTENT_RAM_SIG xor a PRZ-type value) πŸ”₯ It's a uint32_t, so keep it exact please.
  • start β€” the first valid byte in the buffer. That's her position. atomic_t, so she's thread-safe about it πŸ’…
  • size β€” how many valid bytes are actually in the buffer. Also atomic_t. Literally the count of the real ones 🫢
  • data β€” the contents of the buffer. That's the actual payload, the uint8_t[] flexible array doing all the heavy lifting ✨

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./fs/pstore/ram_core.c β€” go read the source, iykyk πŸ’œ

Heads up bestie: sig isn't just any old number β€” it's PERSISTENT_RAM_SIG xor a PRZ-type value, so don't go inventing your own and expecting the kernel to vibe check it as valid πŸ™ˆ

Okay that's the whole page, so proud of you for reading it 🧚 From ./fs/pstore, the October 2026 era, section 9 of the Kernel API Manual β€” mwah, slay, periodt πŸ’–β­πŸŒˆ

πŸ“¦ where this page comes from