]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/fork.c
sched/membarrier: Return -ENOMEM to userspace on memory allocation failure
[linux.git] / kernel / fork.c
index 1d1cd06edbc178daa6347b85b447af3bf83e8d90..d6e552552e526d5ec9bc078170f0fcabc8b12abf 100644 (file)
@@ -903,10 +903,12 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
                tsk->cpus_ptr = &tsk->cpus_mask;
 
        /*
-        * One for us, one for whoever does the "release_task()" (usually
-        * parent)
+        * One for the user space visible state that goes away when reaped.
+        * One for the scheduler.
         */
-       refcount_set(&tsk->usage, 2);
+       refcount_set(&tsk->rcu_users, 2);
+       /* One for the rcu users */
+       refcount_set(&tsk->usage, 1);
 #ifdef CONFIG_BLK_DEV_IO_TRACE
        tsk->btrace_seq = 0;
 #endif