提交 af7a8074 编写于 作者: C Chen Wandun 提交者: Zheng Zengkai

psi: make kabi compatibility for psi in struct cgroup

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I562O9
CVE: NA
backport: openEuler-22.03-LTS

--------------------------------

The cgroup structures are all allocated by the core kernel
code at run time. It is also accessed only the cgroup core code
and so changes made to the cgroup structure should not affect
third-party kernel modules. However, a number of important kernel
data structures do contain pointer to a cgroup structure and so
the kABI signature has to be maintained.
Signed-off-by: NChen Wandun <chenwandun@huawei.com>
Reviewed-by: Nzhangjialin 00591957 <zhangjialin11@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 4d4c10ed
......@@ -487,7 +487,12 @@ struct cgroup {
/* used to schedule release agent */
struct work_struct release_agent_work;
/* used to track pressure stalls */
/* used to track pressure stalls. */
/*
* It is accessed only the cgroup core code and so changes made to
* the cgroup structure should not affect third-party kernel modules.
*/
struct psi_group psi;
/* used to store eBPF programs */
......
......@@ -10,6 +10,28 @@
#ifdef CONFIG_PSI
/* Tracked task states */
#ifdef __GENKSYMS__
/*
* This definition is used to keep kabi unchanged,
* and **should not changed**
*/
enum psi_task_count {
NR_IOWAIT,
NR_MEMSTALL,
NR_RUNNING,
/*
* This can't have values other than 0 or 1 and could be
* implemented as a bit flag. But for now we still have room
* in the first cacheline of psi_group_cpu, and this way we
* don't have to special case any state tracking for it.
*/
NR_ONCPU,
NR_PSI_TASK_COUNTS = 4,
};
#else
/*
* All modification to psi_task_count should apply to here.
*/
enum psi_task_count {
NR_IOWAIT,
NR_MEMSTALL,
......@@ -23,6 +45,7 @@ enum psi_task_count {
NR_ONCPU,
NR_PSI_TASK_COUNTS = 4,
};
#endif
/* Task state bitmasks */
#define TSK_IOWAIT (1 << NR_IOWAIT)
......@@ -44,6 +67,25 @@ enum psi_res {
* SOME: Stalled tasks & working tasks
* FULL: Stalled tasks & no working tasks
*/
#ifdef __GENKSYMS__
/*
* This definition is used to keep kabi unchanged,
* and **should not changed**
*/
enum psi_states {
PSI_IO_SOME,
PSI_IO_FULL,
PSI_MEM_SOME,
PSI_MEM_FULL,
PSI_CPU_SOME,
/* Only per-CPU, to weigh the CPU in the global average: */
PSI_NONIDLE,
NR_PSI_STATES = 6,
};
#else
/*
* All modification to psi_states should apply to here.
*/
enum psi_states {
PSI_IO_SOME,
PSI_IO_FULL,
......@@ -54,6 +96,8 @@ enum psi_states {
PSI_NONIDLE,
NR_PSI_STATES = 6,
};
#endif
enum psi_aggregators {
PSI_AVGS = 0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部