memory_block_aligned_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, this is the memory_block_aligned_range(9) page from the Kernel API Manual β€” and it does exactly what it says on the tin: align a physical address range to memory blocks. No cap. 🫢

✨ SYNOPSIS ✨

struct range memory_block_aligned_range (const struct range *range );

🌸 ARGUMENTS 🌸

  • range β€” the input range to align. That's the range you're handing over for a little boundary glow-up. πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

So the way this works: it aligns the start address up and the end address down to memory block boundaries. It's giving "snap it to the grid," and honestly? Iconic. ✨

This is required for memory hotplug operations which must operate on memory-block aligned ranges. Like, hotplug is not about to deal with a range that's off by a little sliver β€” it needs the block-aligned version, periodt. πŸ”₯

It returns the aligned range. πŸ’…

bestie, quick vibe check: callers should check that the returned range is valid (aligned.start < aligned.end) before using it. Don't skip this, fr fr. 😭

🌈 SEE ALSO 🌈

  • Kernel file ./include/linux/memory.h
  • struct memory_group(9)

mwah πŸ’‹ β€” source/version is ./include/linux, dated October 2026, and this was the memory_block_aligned_range(9) page signing off. πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from