Conclusion
----------
Introducing a new "bpf" mode for BPF-based per-task THP adjustments is the
most effective solution for our requirements. This approach represents a
small but meaningful step toward making THP truly usable—and manageable—in
production environments.
A new "bpf" mode sounds way too special.
We currently have:
never -> never
madvise -> MADV_HUGEPAGE, except PR_SET_THP_DISABLE
always -> always, except PR_SET_THP_DISABLE and MADV_NOHUGEPAGE
Whatever new mode we add, it should honor PR_SET_THP_DISABLE +
MADV_NOHUGEPAGE.
So, if we want another way to enable things, it would live between
"never" and "madvise".
I'm wondering how we could make that generic: likely we want this new
mechanism to *not* be triggerable by the process itself (madvise).
I am not convinced bpf is the answer here ...
--
Cheers,
David / dhildenb