From f395d5810f27a22e5ff0230ca7b3ef88857d98d9 Mon Sep 17 00:00:00 2001 From: Pavankumar Kondeti Date: Thu, 20 Sep 2018 15:31:36 +0530 Subject: sched/walt: Fix the memory leak of idle task load pointers The memory for task load pointers are allocated twice for each idle thread except for the boot CPU. This happens during boot from idle_threads_init()->idle_init() in the following 2 paths. 1. idle_init()->fork_idle()->copy_process()-> sched_fork()->init_new_task_load() 2. idle_init()->fork_idle()-> init_idle()->init_new_task_load() The memory allocation for all tasks happens through the 1st path, so use the same for idle tasks and kill the 2nd path. Since the idle thread of boot CPU does not go through fork_idle(), allocate the memory for it separately. Change-Id: I4696a414ffe07d4114b56d326463026019e278f1 Signed-off-by: Pavankumar Kondeti [schikk@codeaurora.org: resolved merge conflicts] Signed-off-by: Swetha Chikkaboraiah --- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel/fork.c') diff --git a/kernel/fork.c b/kernel/fork.c index 25d0a60d166c..e8bc7ed77b59 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1769,7 +1769,7 @@ struct task_struct *fork_idle(int cpu) cpu_to_node(cpu)); if (!IS_ERR(task)) { init_idle_pids(task->pids); - init_idle(task, cpu, false); + init_idle(task, cpu); } return task; -- cgit v1.2.3