提交 40f483c7 编写于 作者: L Lu Jialin 提交者: Zheng Zengkai

kabi: reserve space for cgroup framework 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 cgroup framework related structures prone
to change, therefore, we can hot add/change features of cgroupv1/cgroupv2 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>
上级 56f99a05
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/bpf-cgroup.h> #include <linux/bpf-cgroup.h>
#include <linux/psi_types.h> #include <linux/psi_types.h>
#include <linux/kabi.h>
#ifdef CONFIG_CGROUPS #ifdef CONFIG_CGROUPS
...@@ -126,6 +127,9 @@ struct cgroup_file { ...@@ -126,6 +127,9 @@ struct cgroup_file {
struct kernfs_node *kn; struct kernfs_node *kn;
unsigned long notified_at; unsigned long notified_at;
struct timer_list notify_timer; struct timer_list notify_timer;
KABI_RESERVE(1)
KABI_RESERVE(2)
}; };
/* /*
...@@ -183,6 +187,11 @@ struct cgroup_subsys_state { ...@@ -183,6 +187,11 @@ struct cgroup_subsys_state {
* fields of the containing structure. * fields of the containing structure.
*/ */
struct cgroup_subsys_state *parent; struct cgroup_subsys_state *parent;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
}; };
/* /*
...@@ -279,6 +288,11 @@ struct css_set { ...@@ -279,6 +288,11 @@ struct css_set {
/* For RCU-protected deletion */ /* For RCU-protected deletion */
struct rcu_head rcu_head; struct rcu_head rcu_head;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
}; };
struct cgroup_base_stat { struct cgroup_base_stat {
...@@ -482,6 +496,10 @@ struct cgroup { ...@@ -482,6 +496,10 @@ struct cgroup {
/* Used to store internal freezer state */ /* Used to store internal freezer state */
struct cgroup_freezer_state freezer; struct cgroup_freezer_state freezer;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
/* ids of the ancestors at each level including self */ /* ids of the ancestors at each level including self */
u64 ancestor_ids[]; u64 ancestor_ids[];
}; };
...@@ -523,6 +541,11 @@ struct cgroup_root { ...@@ -523,6 +541,11 @@ struct cgroup_root {
/* The name for this hierarchy - may be empty */ /* The name for this hierarchy - may be empty */
char name[MAX_CGROUP_ROOT_NAMELEN]; char name[MAX_CGROUP_ROOT_NAMELEN];
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
}; };
/* /*
...@@ -618,6 +641,8 @@ struct cftype { ...@@ -618,6 +641,8 @@ struct cftype {
__poll_t (*poll)(struct kernfs_open_file *of, __poll_t (*poll)(struct kernfs_open_file *of,
struct poll_table_struct *pt); struct poll_table_struct *pt);
KABI_RESERVE(1)
#ifdef CONFIG_DEBUG_LOCK_ALLOC #ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lock_class_key lockdep_key; struct lock_class_key lockdep_key;
#endif #endif
...@@ -650,6 +675,10 @@ struct cgroup_subsys { ...@@ -650,6 +675,10 @@ struct cgroup_subsys {
void (*release)(struct task_struct *task); void (*release)(struct task_struct *task);
void (*bind)(struct cgroup_subsys_state *root_css); void (*bind)(struct cgroup_subsys_state *root_css);
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
bool early_init:1; bool early_init:1;
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册