drbd_alloc_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– drbd_alloc_pages πŸ’–

okay so this is a page from the Kernel API Manual (section 9, yes, the kernel-API girlies) and honestly? it's a whole mood. buckle up bestie πŸŽ€

✨ NAME ✨

drbd_alloc_pages β€” Returns @number pages, and it will retry forever (or until it gets signalled, whichever comes first 😭). no cap, it's stubborn like that.

🌸 SYNOPSIS 🌸

struct page * drbd_alloc_pages (struct drbd_peer_device *peer_device ,
unsigned int number , bool retry );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • peer_device β€” the DRBD device. your main character 🫢
  • number β€” number of pages requested. literally how many pages we're asking for.
  • retry β€” whether to retry, if not enough pages are available right now. yes/no on the "try again" energy πŸ’…

⭐ DESCRIPTION ⭐

So what it does is: it tries to allocate number pages. first it goes shopping in our own page pool, and then it hits up the kernel for the rest. and if that's still not enough, it can possibly retry until DRBD frees sufficient pages somewhere else β€” because sometimes the vibe check is "come back later" 😌✨

If this allocation would exceed the max_buffers setting, we throttle allocation (schedule_timeout) to give the system some room to breathe. literally just telling it to inhale, hold, exhale πŸ§˜β€β™€οΈ

and now the serious part bestie, pay attention: we do not use max-buffers as a hard limit. why? because it could lead to congestion and further to a distributed deadlock during online-verify or (checksum based) resync, if the max-buffers, socket buffer sizes and resync-rate settings are mis-configured. so like… please don't mis-configure those. deadlock is not the aesthetic πŸ’€πŸ”₯

Returns a page chain linked via page->private. cute little linked list, we love to see it πŸŽ€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/block/drbd/drbd_receiver.c β€” that's where the lore lives πŸ¦‹


that's the whole thing babes, no notes πŸ’… from ./drivers/block/drbd, dated October 2026 β€” mwah, go read the source, it's giving iconic πŸŒˆπŸ’–β­

πŸ“¦ where this page comes from