vmballoon_alloc_page_list(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🎈 vmballoon_alloc_page_list(9) β€” the Kernel API Manual, bestie edition 🎈

Okay so real talk, this is vmballoon_alloc_page_list, straight out of the Kernel API Manual (section 9, the fancy kernel-internals one πŸ’…). It's the little helper that goes out and grabs you a whole list of pages for the balloon driver. Let's get into it.


✨ SYNOPSIS ✨

int vmballoon_alloc_page_list (struct vmballoon *b , struct
vmballoon_ctl *ctl , unsigned int req_n_pages );

That return type is int, no cap. 🫢


🌸 ARGUMENTS 🌸

  • b β€” pointer to the balloon. Yes, literally a balloon. It's the struct vmballoon * and it's the main character here.
  • ctl β€” pointer for the struct vmballoon_ctl, which defines the operation. It's the vibe-setter, it tells everyone what we're actually doing.
  • req_n_pages β€” the number of requested pages. An unsigned int, so, like, how many do you want bestie.

πŸ¦‹ DESCRIPTION πŸ¦‹

So what it does is: it tries to allocate req_n_pages. Then it adds them to the list of balloon pages in ctl.pages β€” and bestie it also updates ctl.n_pages to reflect the number of pages. Like it keeps the receipts in sync, love that for us. ✨


πŸ’– RETURN πŸ’–

Returns zero on success, or an error code otherwise. So 0 means slay, anything else means something went sideways. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/misc/vmw_balloon.c and honestly the whole friend group:

enum vmballoon_cmd_type(9), struct vmballoon_batch_entry(9), vmballoon_send_guest_id(9), vmballoon_page_order(9), vmballoon_page_in_frames(9), vmballoon_mark_page_offline(9), vmballoon_mark_page_online(9), vmballoon_send_get_target(9), vmballoon_handle_one_result(9), vmballoon_status_page(9), vmballoon_lock_op(9), vmballoon_add_page(9), vmballoon_lock(9), vmballoon_release_page_list(9), vmballoon_change(9), vmballoon_enqueue_page_list(9), vmballoon_dequeue_page_list(9), vmballoon_split_refused_pages(9), vmballoon_inflate(9), vmballoon_deflate(9), vmballoon_deinit_batching(9), vmballoon_init_batching(9), vmballoon_vmci_init(9), vmballoon_pop(9), vmballoon_work(9), vmballoon_shrinker_scan(9), vmballoon_shrinker_count(9), vmballoon_debug_show(9), vmballoon_migratepage(9)


Sign-off time πŸŽ€ β€” this little gem lives in <code>./drivers/misc</code>, and the page is dated October 2026. That's the whole footer, no gatekeeping. Go allocate some pages, bestie. πŸ’œ

πŸ“¦ where this page comes from