File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Documentation/admin-guide/mm Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -738,3 +738,42 @@ support enabled just fine as always. No difference can be noted in
738738hugetlbfs other than there will be less overall fragmentation. All
739739usual features belonging to hugetlbfs are preserved and
740740unaffected. libhugetlbfs will also work fine as usual.
741+
742+ BPF THP
743+ =======
744+
745+ Overview
746+ --------
747+
748+ When the system is configured with "always" or "madvise" THP mode, a BPF program
749+ can be used to adjust THP allocation policies dynamically. This enables
750+ fine-grained control over THP decisions based on various factors including
751+ workload identity, allocation context, and system memory pressure.
752+
753+ Program Interface
754+ -----------------
755+
756+ This feature implements a struct_ops BPF program with the following interface::
757+
758+ int thp_get_order(struct vm_area_struct *vma,
759+ enum tva_type type,
760+ unsigned long orders);
761+
762+ Parameters::
763+
764+ @vma: vm_area_struct associated with the THP allocation
765+ @type: TVA type for current @vma
766+ @orders: Bitmask of available THP orders for this allocation
767+
768+ Return value::
769+
770+ The suggested THP order for allocation from the BPF program. Must be
771+ a valid, available order.
772+
773+ Implementation Notes
774+ --------------------
775+
776+ This is currently an experimental feature. CONFIG_BPF_THP (EXPERIMENTAL) must be
777+ enabled to use it. Only one BPF program can be attached at a time, but the
778+ program can be updated dynamically to adjust policies without requiring affected
779+ tasks to be restarted.
You can’t perform that action at this time.
0 commit comments