summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJoonwoo Park <joonwoop@codeaurora.org>2016-11-28 13:41:18 -0800
committerJoonwoo Park <joonwoop@codeaurora.org>2016-12-01 11:28:01 -0800
commit7437cd7c4bb7a463ec2cac7c37283f9eec5c01c2 (patch)
tree78de070f02650f605f49d8884a9c4a73753644a0 /include
parent9aa1df0cf5ffb58b52b55b4fe2ea6531f795e186 (diff)
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 <joonwoop@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched.h2
1 files changed, 2 insertions, 0 deletions
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);