zs_malloc(9)
π zs_malloc(9) π
okay bestie, welcome to the Kernel API Manual entry for zs_malloc β yes, we're literally allocating a block of a given size from a pool, and it's giving kernel-core main character energy π
β¨
πΈ NAME πΈ
zs_malloc β allocate a block of the given size from a pool. that's the whole vibe π«Ά
β¨ SYNOPSIS β¨
unsigned long zs_malloc (struct zs_pool *pool , size_t size , gfp_t gfp
, const int nid );
π ARGUMENTS π
poolβ the pool you're allocating from, bestie. that's the source πββοΈsizeβ the size of the block to allocate. yes, size matters πgfpβ thegfpflags used when allocating the object π±nidβ the preferred node id for allocating a newzspage(if needed). key phrase: if needed π
π¦ DESCRIPTION π¦
so here's the tea: on success, zs_malloc returns a handle to the allocated object. slay. π
otherwise? you get an ERR_PTR. not the cute kind of surprise π
β οΈ heads up: allocation requests with size > ZS_MAX_ALLOC_SIZE will fail. no cap, that's the limit. π
π SEE ALSO π
- Kernel file
./mm/zsmalloc.c obj_to_location(9)location_to_obj(9)zs_lookup_class_index(9)zs_huge_class_size(9)zs_create_pool(9)
and that's the page, bestie π source/version: ./mm β dated October 2026 πβ¨ go forth and allocate 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