From: Guan Jing guanjing6@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4KAP1?from=project-issue CVE: NA
-------------------------------
We reserve some fields beforehand for sched structures prone to change, therefore, we can hot add/change features of sched with this enhancement. After reserving, normally cache does not matter as the reserved fields are not accessed at all.
Signed-off-by: Guan Jing guanjing6@huawei.com Reviewed-by: Chen Hui judy.chenhui@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- include/linux/sched.h | 15 +++++++++++++++ kernel/sched/sched.h | 13 +++++++++++++ 2 files changed, 28 insertions(+)
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5cd59c883522..c33f7a70629a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -668,6 +668,12 @@ struct wake_q_node { struct wake_q_node *next; };
+/** +* struct task_struct_resvd - KABI extension struct +*/ +struct task_struct_resvd { +}; + struct task_struct { #ifdef CONFIG_THREAD_INFO_IN_TASK /* @@ -1394,6 +1400,15 @@ struct task_struct { KABI_RESERVE(6) KABI_RESERVE(7) KABI_RESERVE(8) + KABI_RESERVE(9) + KABI_RESERVE(10) + KABI_RESERVE(11) + KABI_RESERVE(12) + KABI_RESERVE(13) + KABI_RESERVE(14) + KABI_RESERVE(15) + KABI_RESERVE(16) + KABI_AUX_PTR(task_struct)
/* CPU-specific state of this task: */ struct thread_struct thread; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 66be40862d99..d122f1b8e3e6 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -386,6 +386,11 @@ struct cfs_bandwidth { u64 throttled_time;
KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) #endif };
@@ -623,6 +628,8 @@ struct cfs_rq {
KABI_RESERVE(1) KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
static inline int rt_bandwidth_enabled(void) @@ -1091,6 +1098,12 @@ struct rq {
KABI_RESERVE(1) KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) };
#ifdef CONFIG_FAIR_GROUP_SCHED