Commit af7a8074 authored by Chen Wandun's avatar Chen Wandun Committed by Zheng Zengkai
Browse files

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: default avatarChen Wandun <chenwandun@huawei.com>
Reviewed-by: default avatarzhangjialin 00591957 <zhangjialin11@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 4d4c10ed
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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 */
+44 −0
Original line number Diff line number Diff line
@@ -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,