Commit 283fde80 authored by Lu Jialin's avatar Lu Jialin Committed by Zheng Zengkai
Browse files

kabi: reserve space for memcg related structures

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4GII8?from=project-issue


CVE: NA

--------

We reserve some fields beforehand for memcg related structures prone
to change, therefore, we can hot add/change features of memcg with this enhancement.

After reserving, normally cache does not matter as the reserved fields
are not accessed at all.

--------

Signed-off-by: default avatarLu Jialin <lujialin4@huawei.com>
Reviewed-by: default avatarweiyang wang <wangweiyang2@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 40f483c7
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/vmstat.h>
#include <linux/writeback.h>
#include <linux/page-flags.h>
#include <linux/kabi.h>

struct mem_cgroup;
struct obj_cgroup;
@@ -61,6 +62,7 @@ struct mem_cgroup_reclaim_cookie {
struct mem_cgroup_id {
	int id;
	refcount_t ref;
	KABI_RESERVE(1)
};

/*
@@ -87,6 +89,9 @@ struct memcg_vmstats_percpu {
	/* Cgroup1: threshold notifications & softlimit tree updates */
	unsigned long		nr_page_events;
	unsigned long		targets[MEM_CGROUP_NTARGETS];

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

struct memcg_vmstats {
@@ -152,6 +157,12 @@ struct mem_cgroup_per_node {
	bool			on_tree;
	struct mem_cgroup	*memcg;		/* Back pointer, we cannot */
						/* use container_of	   */

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
	KABI_RESERVE(5)
};

struct mem_cgroup_threshold {
@@ -359,6 +370,15 @@ struct mem_cgroup {
	struct deferred_split deferred_split_queue;
#endif

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
	KABI_RESERVE(5)
	KABI_RESERVE(6)
	KABI_RESERVE(7)
	KABI_RESERVE(8)

	struct mem_cgroup_per_node *nodeinfo[0];
	/* WARNING: nodeinfo must be the last member here */
};