Skip to content

mm/memcg: Exclude mem_cgroup pointer from kABI signature computation

Waiman Long requested to merge llong1/centos-stream-9:bz2036995_memcg into main

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2036995
MR: !326 (merged)
Upstream Status: RHEL only

The mem_cgroup structure is allocated dynamically, self-contained and is not embedded in other data structures. Third-party kernel modules are not supposed to access mem_cgroup structure directly.

To support new features, mem_cgroup structure often changes quite a lot over time. However, a number of other important data structures like the task_struct contain pointers to mem_cgroup. So any change to mem_cgroup can affect the kABI signatures of the other data structures leading to kABI breakage.

Instead of carefully messaging the mem_cgroup structure every time when change is needed in order not to break kABI signature, it is more efficient to just decouple changes to mem_cgroup from affecting kABI signatures of other data structures by using the RH_KABI_EXCLUDE() macro to exclude mem_cgroup pointers from being included in the computation of kABI signature.

This macro is applied to mem_cgroup pointers in the task_struct, bpf_map, fsnotify_group and sock data structures.

Signed-off-by: Waiman Long longman@redhat.com

Edited by Waiman Long

Merge request reports