From 7437cd7c4bb7a463ec2cac7c37283f9eec5c01c2 Mon Sep 17 00:00:00 2001 From: Joonwoo Park Date: Mon, 28 Nov 2016 13:41:18 -0800 Subject: sched: pre-allocate colocation groups At present, sched_set_group_id() dynamically allocates structure for colocation group to assign the given task to the group. However this can cause deadlock as memory allocator can wakeup a task which also tries to acquire related_thread_group_lock. Avoid such deadlock by pre-allocating colocation structures. This limits maximum colocation groups to static number but it's fine as it's never expected to be a lot. Change-Id: Ifc32ab4ead63c382ae390358ed86f7cc5b6eb2dc Signed-off-by: Joonwoo Park --- include/linux/sched.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/sched.h b/include/linux/sched.h index 4f6711f31939..9c3be2d56ac5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2401,6 +2401,8 @@ struct cpu_cycle_counter_cb { u64 (*get_cpu_cycle_counter)(int cpu); }; +#define MAX_NUM_CGROUP_COLOC_ID 20 + #ifdef CONFIG_SCHED_HMP extern void free_task_load_ptrs(struct task_struct *p); extern int sched_set_window(u64 window_start, unsigned int window_size); -- cgit v1.2.3