From 7a2a316228bcd80821a15fed6cd70c80a5daa182 Mon Sep 17 00:00:00 2001 From: Satya Durga Srinivasu Prabhala Date: Wed, 28 Oct 2020 00:02:04 -0700 Subject: [PATCH] ANDROID: sched: gki: add padding to some structs to support WALT Add padding to below structs to support WALT based accounting: 1. struct cpu_topology 2. struct task_struct 3. struct sched_domain_shared 4. struct task_group 5. struct root_domain 6. struct rq To accommodate potential future changes, reserving more memory than what WALT needs today. Bug: 171858786 Change-Id: If6d901174fc7963be3ae44daa799cb2953669ec1 Signed-off-by: Satya Durga Srinivasu Prabhala --- include/linux/arch_topology.h | 3 +++ include/linux/sched.h | 2 +- include/linux/sched/topology.h | 3 +++ kernel/sched/sched.h | 7 +++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index 0f6cd6b73a61..3f33dfe7f808 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -7,6 +7,7 @@ #include #include +#include void topology_normalize_cpu_scale(void); int topology_update_cpu_topology(void); @@ -54,6 +55,8 @@ struct cpu_topology { cpumask_t thread_sibling; cpumask_t core_sibling; cpumask_t llc_sibling; + + cpumask_t android_vendor_data1; }; #ifdef CONFIG_GENERIC_ARCH_TOPOLOGY diff --git a/include/linux/sched.h b/include/linux/sched.h index 9d80893f4d14..ecb71323a6b5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1330,7 +1330,7 @@ struct task_struct { __mce_reserved : 62; struct callback_head mce_kill_me; #endif - ANDROID_VENDOR_DATA_ARRAY(1, 2); + ANDROID_VENDOR_DATA_ARRAY(1, 64); /* * New fields for task_struct should be added above here, so that diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 9ef7bf686a9f..452158253764 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -3,6 +3,7 @@ #define _LINUX_SCHED_TOPOLOGY_H #include +#include #include @@ -74,6 +75,8 @@ struct sched_domain_shared { atomic_t ref; atomic_t nr_busy_cpus; int has_idle_cores; + + ANDROID_VENDOR_DATA(1); }; struct sched_domain { diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 00d65f80b80b..98da2587800b 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -430,6 +431,8 @@ struct task_group { struct uclamp_se uclamp[UCLAMP_CNT]; /* Latency-sensitive flag used for a task group */ unsigned int latency_sensitive; + + ANDROID_VENDOR_DATA_ARRAY(1, 4); #endif }; @@ -830,6 +833,8 @@ struct root_domain { * CPUs of the rd. Protected by RCU. */ struct perf_domain __rcu *pd; + + ANDROID_VENDOR_DATA_ARRAY(1, 4); }; extern void init_defrootdomain(void); @@ -1050,6 +1055,8 @@ struct rq { /* Must be inspected within a rcu lock section */ struct cpuidle_state *idle_state; #endif + + ANDROID_VENDOR_DATA_ARRAY(1, 96); }; #ifdef CONFIG_FAIR_GROUP_SCHED