Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2aba290 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Gerrit - the friendly Code Review server
Browse files

sched/walt: Use __GFP_NOFAIL flag for curr/prev window CPU arrays



The system is killed when the memory allocation is failed for
the curr/prev window CPU arrays. Since these are small allocations
and they never fail except in scenarios like

(1) Testing with random memory failures induced
(2) When a fatal signal is pending for the task which is doing
allocations.

Instead of killing the system, use __GFP_NOFAIL flag.

Change-Id: If284814db5a6504b2f039053856ff30c2842808b
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent c153c0af
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -2000,11 +2000,10 @@ void init_new_task_load(struct task_struct *p)
	memset(&p->ravg, 0, sizeof(struct ravg));
	p->cpu_cycles = 0;

	p->ravg.curr_window_cpu = kcalloc(nr_cpu_ids, sizeof(u32), GFP_KERNEL);
	p->ravg.prev_window_cpu = kcalloc(nr_cpu_ids, sizeof(u32), GFP_KERNEL);

	/* Don't have much choice. CPU frequency would be bogus */
	BUG_ON(!p->ravg.curr_window_cpu || !p->ravg.prev_window_cpu);
	p->ravg.curr_window_cpu = kcalloc(nr_cpu_ids, sizeof(u32),
					  GFP_KERNEL | __GFP_NOFAIL);
	p->ravg.prev_window_cpu = kcalloc(nr_cpu_ids, sizeof(u32),
					  GFP_KERNEL | __GFP_NOFAIL);

	if (init_load_pct) {
		init_load_windows = div64_u64((u64)init_load_pct *