STRUCT PERSISTENT_RAM_BUFFER(9)
β¨ 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'sPERSISTENT_RAM_SIGxor aPRZ-type value) π₯ It's auint32_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. Alsoatomic_t. Literally the count of the real ones π«Άdataβ the contents of the buffer. That's the actual payload, theuint8_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:sigisn't just any old number β it'sPERSISTENT_RAM_SIGxor aPRZ-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
- 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