edac_mc_alloc(9)
π edac_mc_alloc(9) π
okay so bestie, welcome to the Kernel API Manual page for edac_mc_alloc β she's a function, she's iconic, she allocates and partially fills a struct &mem_ctl_info, and honestly? she eats. π
β¨ NAME β¨
edac_mc_alloc β Allocate and partially fill a struct &mem_ctl_info. π«Ά
πΈ SYNOPSIS πΈ
struct mem_ctl_info * edac_mc_alloc (unsigned int mc_num , unsigned int
n_layers , struct edac_mc_layer *layers , unsigned int sz_pvt );
like literally that's the whole signature, no cap π
π¦ ARGUMENTS π¦
mc_numβ Memory controller number. that's the number, bestie π’n_layersβ Number of MC hierarchy layers. how many layers we're layering πlayersβ Describes each layer as seen by the Memory Controller. it's giving the blueprint πsz_pvtβ size of private storage needed. your own lil private stash β¨
π DESCRIPTION π
okay so the vibes here are efficiency. Everything is kmalloc'ed as one big chunk β more efficient. one big chunk, one big slay. π₯
but β οΈ Only can be used if all structures have the same lifetime β otherwise you have to allocate and initialize your own structures. fr fr, same lifetime or it's DIY time π
Use edac_mc_free to free mc structures allocated by this function. she giveth, and she taketh away π§
π NOTE: π
drivers handle multi-rank memories in different ways: in some drivers, one multi-rank memory stick is mapped as one entry, while, in others, a single multi-rank memory stick would be mapped into several entries. currently, this function will allocate multiple struct dimm_info on such scenarios, as grouping the multiple ranks require drivers change. iykyk π€·ββοΈ
β RETURN β
On success, return a pointer to struct mem_ctl_info pointer; NULL otherwise. we love a pointer that either works or doesn't π
π SEE ALSO π
Kernel file ./drivers/edac/edac_mc.h and her whole friend group:
edac_get_owner(9)edac_mc_free(9)edac_has_mcs(9)edac_mc_find(9)find_mci_by_dev(9)edac_mc_del_mc(9)edac_mc_find_csrow_by_page(9)edac_raw_mc_handle_error(9)edac_mc_handle_error(9)
go read them, they're all main character energy π
and that's the page bestie!! πβ¨ this one comes from ./drivers/edac, dated October 2026, and yes she's officially edac_mc_alloc(9) β stan her, memorize her, 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