MEMCONTROL(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– NAME

ok so memcontrol β€” the whole vibe is controlling how your system cache behaves, but specifically with respect to memory. that's it. that's the girl. πŸŽ€


✨ SYNOPSIS

memcontrol list [-a]
memcontrol set -b base -l length -o owner attribute
memcontrol clear -o owner
memcontrol clear -b base -l length

🌸 DESCRIPTION

bestie. listen. a bunch of supported system architectures let you program the CPU cache to act differently depending on which region is being written. that's the whole plot. πŸ”₯

memcontrol is literally just the interface to that facility β€” it lets you alter CPU cache behavior for ranges of system physical memory. no cap. ✨

now the fine print, and it's important: these ranges are typically power-of-2 aligned and sized, but the exact rules for how they're allowed to be laid out vary between architectures. memcontrol doesn't try to enforce any of those rules β€” it's not the hall monitor β€” but the system will reject any attempt to set an illegal combination. πŸ’€ so like, play nice.

πŸ¦‹ list

Lists range slots. that's it. show me the slots.

  • -a β€” list all the range slots, even the inactive ones. we love an inclusive queen. πŸ‘‘

πŸ’… set

Sets memory range attributes. this is where you actually do stuff.

  • -b base β€” the memory range base address.
  • -l length β€” the length of the memory range, in bytes, and it's a power of 2. periodt.
  • -o owner β€” a text identifier for this setting. watch it: 7 char max. that's a hard limit, i don't make the rules, she does. πŸ“
  • attribute β€” the attributes applied to this range. it's any combination of force, uncacheable, write-combine, write-through, write-back, and write-protect. yes, mix and match, go off. πŸ’œ

🧚 clear

Clears memory range attributes. and here's the cute part β€” you can clear either by owner or by the base/length combination. two paths, one destination. 🌈

To clear based on ownership:

  • -o owner β€” every single range with this owner gets cleared. all of them. she's thorough. ✨

To clear based on the base/length combination:

  • -b base β€” the memory range base address.
  • -l length β€” the length of the memory range, in bytes, power of 2.
⚠️ okay heads up: base and length must exactly match an existing range. exactly. not "close enough", not "spiritually similar". exact. πŸ’€

πŸ‘€ SEE ALSO

mem(4) β€” go read it, iykyk 🫢


mwah, that's the whole page! πŸ’– this little number is from the Debian crew, dated September 15, 2002, living in the System Manager's Manual as memcontrol(8) β€” iconic behavior, honestly. πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from