scribble_alloc(9)
π scribble_alloc(9) β a Kernel API Manual moment π
okay so bestie, this one's from the kernel API manual (section 9, the fancy "kernel internals" section, iykyk) and it's called scribble_alloc. yes, scribble. like the scratch paper of the kernel. we love an underrated icon π
β¨ NAME β¨
scribble_alloc β allocate percpu scribble buffer for required size of the scribble region
like, it goes and gets you the scratch space. for one cpu's worth. that's the whole vibe π
π¦ SYNOPSIS π¦
int scribble_alloc (struct raid5_percpu *percpu , int num , int cnt );
returns an int, takes three args. no cap, that's it π«Ά
πΈ ARGUMENTS πΈ
percpuβ fromfor_each_present_cpuof the caller. so whoever's calling this is looping over the present cpus and hands you the one they're on rn πnumβ total number of disks in the array. the whole squad, not just the data ones βcntβ scribble objs count for required size of the scribble region. literally the count of scribble objects that decides how big the region needs to be π
π₯ DESCRIPTION π₯
okay so the whole point: the scribble buffer size must be enough to contain two things, and the manpage numbers them, so we're numbering them:
- a
struct pagepointer for each device in the array +2 - room to convert each entry in (1) to its corresponding dma (
dma_map_page) or page (page_address) address
that's the requirement. that's the assignment. main character energy honestly π
π NOTE π
and before you ask about the +2 β the +2 is for the destination buffers of the ddf/raid6 case where we calculate over all devices (not just the data blocks), using zeros in place of the P and Q blocks. so it's not a random +2, it's a very deliberate +2, respect it π
π SEE ALSO π
Kernel file ./drivers/md/raid5.c
like, go read the actual source if you want the lore. it's all in there, fr fr π§
so that's the page, bestie π this little gem lives in ./drivers/md and it's dated October 2026, and yeah, the whole thing is signed scribble_alloc(9) β go forth and allocate your scribbles responsibly, mwah π
β¨
π¦ 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