sparse_add_section(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to sparse_add_section(9) from the Kernel API Manual β€” she adds a memory section, or populates one that’s already there. lowkey iconic. ✨


✨ SYNOPSIS ✨

int sparse_add_section (int nid , unsigned long start_pfn , unsigned
       long nr_pages , struct vmem_altmap *altmap , struct dev_pagemap *pgmap
       );

πŸŽ€ ARGUMENTS πŸŽ€

  • nid β€” the node to add the section on. like, which node bestie πŸ’…
  • start_pfn β€” start pfn of the memory range. periodt.
  • nr_pages β€” number of pfns to add in the section.
  • altmap β€” alternate pfns to allocate the memmap backing store.
  • pgmap β€” alternate compound page geometry for devmap mappings.

πŸ¦‹ DESCRIPTION πŸ¦‹

so this one is only intended for hotplug. no cap. 🫢

note bestie: only VMEMMAP supports sub-section aligned hotplug, and the proper alignment and size are gated by check_pfn_span. that part is literally the vibe check. πŸ’€

πŸ”₯ RETURN πŸ”₯

  • 0 β€” on success. slay. πŸ’–
  • -EEXIST β€” section has been present. like, it’s already there, bestie. πŸ™ˆ
  • -ENOMEM β€” out of memory. 😭

🌈 SEE ALSO 🌈

kernel file ./mm/sparse-vmemmap.c β€” go peek, iykyk. πŸ¦‹


mwah πŸ’‹ β€” source/version: ./mm, date: October 2026, page: sparse_add_section(9). that’s the cute little sign-off, bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from