aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 158ca4f..ba7e2bc 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -317,6 +317,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
account_kernel_stack(ti, 1);
+ RB_CLEAR_NODE(&tsk->adj_node);
+
return tsk;
out:
@@ -1009,6 +1011,10 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
sig->oom_score_adj = current->signal->oom_score_adj;
sig->oom_score_adj_min = current->signal->oom_score_adj_min;
+#ifdef CONFIG_ANDROID_LMK_ADJ_RBTREE
+ RB_CLEAR_NODE(&sig->adj_node);
+#endif
+
mutex_init(&sig->cred_guard_mutex);
return 0;
@@ -1375,6 +1381,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
attach_pid(p, PIDTYPE_SID, task_session(current));
list_add_tail(&p->sibling, &p->real_parent->children);
list_add_tail_rcu(&p->tasks, &init_task.tasks);
+ add_2_adj_tree(p);
__this_cpu_inc(process_counts);
}
attach_pid(p, PIDTYPE_PID, pid);