提交 283fde80 编写于 作者: L Lu Jialin 提交者: Zheng Zengkai

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: NLu Jialin <lujialin4@huawei.com>
Reviewed-by: Nweiyang wang <wangweiyang2@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 40f483c7
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/vmstat.h> #include <linux/vmstat.h>
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/page-flags.h> #include <linux/page-flags.h>
#include <linux/kabi.h>
struct mem_cgroup; struct mem_cgroup;
struct obj_cgroup; struct obj_cgroup;
...@@ -61,6 +62,7 @@ struct mem_cgroup_reclaim_cookie { ...@@ -61,6 +62,7 @@ struct mem_cgroup_reclaim_cookie {
struct mem_cgroup_id { struct mem_cgroup_id {
int id; int id;
refcount_t ref; refcount_t ref;
KABI_RESERVE(1)
}; };
/* /*
...@@ -87,6 +89,9 @@ struct memcg_vmstats_percpu { ...@@ -87,6 +89,9 @@ struct memcg_vmstats_percpu {
/* Cgroup1: threshold notifications & softlimit tree updates */ /* Cgroup1: threshold notifications & softlimit tree updates */
unsigned long nr_page_events; unsigned long nr_page_events;
unsigned long targets[MEM_CGROUP_NTARGETS]; unsigned long targets[MEM_CGROUP_NTARGETS];
KABI_RESERVE(1)
KABI_RESERVE(2)
}; };
struct memcg_vmstats { struct memcg_vmstats {
...@@ -152,6 +157,12 @@ struct mem_cgroup_per_node { ...@@ -152,6 +157,12 @@ struct mem_cgroup_per_node {
bool on_tree; bool on_tree;
struct mem_cgroup *memcg; /* Back pointer, we cannot */ struct mem_cgroup *memcg; /* Back pointer, we cannot */
/* use container_of */ /* use container_of */
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
KABI_RESERVE(5)
}; };
struct mem_cgroup_threshold { struct mem_cgroup_threshold {
...@@ -359,6 +370,15 @@ struct mem_cgroup { ...@@ -359,6 +370,15 @@ struct mem_cgroup {
struct deferred_split deferred_split_queue; struct deferred_split deferred_split_queue;
#endif #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]; struct mem_cgroup_per_node *nodeinfo[0];
/* WARNING: nodeinfo must be the last member here */ /* WARNING: nodeinfo must be the last member here */
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册