ANDROID: Configure out the macros in android_kabi and android_vendor

Add one CONFIG to control removing the macros or not. On some platform,
configureing out the macros removes the associated members from the
structs, this reduces the object size of the slabs related with the
structs, therefore reduces the total slab memory consumption of system.

Besides, this also reduces vmlinux size a bit, therefore the total
kernel memory size increses a bit.

The macros are ANDROID_KABI_RESERVE, ANDROID_VENDOR_DATA,
ANDROID_VENDOR_DATA_ARRAY, ANDROID_OEM_DATA, ANDROID_OEM_DATA_ARRAY.

Bug: 206561931
Signed-off-by: Qingqing Zhou <quic_qqzhou@quicinc.com>
Change-Id: I0868d299ccce3c4b39f42af17916828500be6cc4
This commit is contained in:
Qingqing Zhou
2021-11-30 10:20:40 +08:00
parent bdc772adbd
commit b7a6c15a6f
5 changed files with 42 additions and 2 deletions

View File

@@ -978,8 +978,10 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
#ifdef CONFIG_MEMCG
tsk->active_memcg = NULL;
#endif
memset(&tsk->android_vendor_data1, 0, sizeof(tsk->android_vendor_data1));
memset(&tsk->android_oem_data1, 0, sizeof(tsk->android_oem_data1));
android_init_vendor_data(tsk, 1);
android_init_oem_data(tsk, 1);
trace_android_vh_dup_task_struct(tsk, orig);
return tsk;