rpc_malloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

hey bestie πŸ’– welcome to rpc_malloc(9), fresh from the Kernel API Manual. this is the kernel page about allocating RPC buffer resources, and she's lowkey iconic.

🌸 NAME 🌸

rpc_malloc β€” allocate RPC buffer resources. literally that's the job: it allocates RPC buffer resources, no cap.

πŸ¦‹ SYNOPSIS πŸ¦‹

int rpc_malloc (struct rpc_task *task );

πŸŽ€ ARGUMENTS πŸŽ€

  • task β€” the RPC task. your main character task, fr.

πŸ’… DESCRIPTION πŸ’…

okay so a single memory region gets allocated, and it's split between the RPC call and the RPC reply that this task is being used for. when this RPC is retired, that memory is released by calling rpc_free. periodt.

to prevent rpciod from hanging, this allocator never sleeps. it's giving "no sleeping allowed." instead it returns -ENOMEM and suppresses the warning if the request cannot be serviced immediately. the caller can arrange to sleep in a way that is safe for rpciod, bestie.

most requests are 'small' (under 2KiB) and can be serviced from a mempool. that ensures NFS reads and writes can always proceed, and that there is good locality of reference for these buffers. slay for buffer locality honestly πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./net/sunrpc/sched.c, plus these icons right here:


okay bye bestie 🫢 this page comes from source/version ./net/sunrpc, dated October 2026, and it's rpc_malloc(9) out here. stay allocated, stay slay πŸ’…βœ¨

πŸ“¦ where this page comes from