pcpu_next_fit_region(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

pcpu_next_fit_region - finds fit areas for a given allocation request. This is from the Kernel API Manual, and yes bestie, we’re about to get into it. πŸ’–

✨ SYNOPSIS ✨

Okay, here’s the signature, copied exactly because we do not play with code:

void pcpu_next_fit_region (struct pcpu_chunk *chunk , int alloc_bits ,
int align , int *bit_off , int *bits );

🫢 ARGUMENTS 🫢

  • chunk β€” chunk of interest. Your chunk, your business.
  • alloc_bits β€” size of allocation. How much you’re asking for.
  • align β€” alignment of area (max PAGE_SIZE). Keep it aligned, queen.
  • bit_off β€” chunk offset. Where in the chunk we’re looking.
  • bits β€” size of free area. How much free space is there.

πŸ’… DESCRIPTION πŸ’…

Okay so this function finds the next free region that is viable for use with a given size and alignment. It only returns if there is a valid area to be used for this allocation β€” no cap, it’s not gonna hand you a fake region. ✨

And here’s the little detail that matters: block->first_free is returned if the allocation request fits within the block, so you can see if the request can be fulfilled prior to the contig hint. That’s the vibe check for this one. πŸ¦‹

🌈 SEE ALSO 🌈

Kernel file ./mm/percpu.c β€” also check out the whole iconic friend group: pcpu_addr_in_chunk(9), pcpu_check_block_hint(9), pcpu_next_md_free_region(9), pcpu_mem_zalloc(9), pcpu_mem_free(9), pcpu_chunk_relocate(9), pcpu_block_update(9), pcpu_chunk_refresh_hint(9), pcpu_block_refresh_hint(9), pcpu_block_update_hint_alloc(9), pcpu_block_update_hint_free(9), pcpu_is_populated(9), pcpu_find_block_fit(9), pcpu_alloc_area(9), pcpu_free_area(9), pcpu_alloc_first_chunk(9), pcpu_chunk_populated(9), pcpu_chunk_depopulated(9), pcpu_chunk_addr_search(9), pcpu_alloc(9), pcpu_balance_free(9), pcpu_balance_populated(9), pcpu_reclaim_populated(9), pcpu_balance_workfn(9), free_percpu(9), is_kernel_percpu_address(9), per_cpu_ptr_to_phys(9), pcpu_alloc_alloc_info(9), pcpu_free_alloc_info(9), pcpu_dump_alloc_info(9), pcpu_setup_first_chunk(9), pcpu_build_alloc_info(9), pcpu_embed_first_chunk(9), pcpu_page_first_chunk(9).


Source/version footer tea β˜•: ./mm, October 2026, pcpu_next_fit_region(9). That’s the whole page, bestie β€” mwah! πŸ’‹πŸŽ€

πŸ“¦ where this page comes from