__flush_hash_table_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 __flush_hash_table_range β€” NAME ✨

ok so __flush_hash_table_range πŸ’… β€” it flushes all the HPTEs for a given address range out of the hash table (and the TLB too, bestie!), but lowkey leaves the linux PTEs completely intact. no cap, they stay right where they are 🫢

(this is page 9 of the Kernel API Manual, mwah πŸ’–)


πŸ¦‹ SYNOPSIS

void __flush_hash_table_range (unsigned long start , unsigned long end );

like, that's the whole signature. two unsigned longs and vibes ✨


πŸŽ€ ARGUMENTS

  • start β€” the starting address. where the party begins πŸŽ‰
  • end β€” the ending address, and heads up: it's not included in the flush πŸ™ˆ (exclusive, iykyk)

πŸ‘‘ DESCRIPTION

ok so picture this: this function is mostly meant to be used by some IO hotplug code πŸ”₯ the goal is to remove all the hash entries from a given address range that was used to map IO space on a removed PCI-PCI bridge β€” without tearing down the full mapping. why? because 64K pages may overlap with other bridges when you're using 64K pages with 4K HW pages on IO space 😭 it's giving "surgical, not scorched-earth."

and because of that exact usage pattern, it's implemented for small size rather than speed πŸ’€ so don't come at it expecting a speed demon β€” it was built petite, not fast. periodt.

ngl, it's a small-and-mighty situation, not a benchmark queen πŸ‘‘

🌈 SEE ALSO

  • Kernel file ./arch/powerpc/mm/book3s64/hash_tlb.c β€” go read it bestie, it's right there 🧚

β­πŸ’œ that's the whole page, fr fr. brought to you by ./arch/powerpc/mm/book3s64, dated October 2026, and honestly? iconic. slay πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from