Re: [PATCH] sched, cgroup: Use exit hook to avoid use-after-freecrash

From: Peter Zijlstra
Date: Mon Jan 03 2011 - 02:06:58 EST

On Sat, 2010-12-25 at 20:59 +0000, Paul Menage wrote:

> While this patch is likely fine for solving the problem, it does add
> extra work into the task exit path.
> Could you instead just use the pre_destroy callback to return -EBUSY
> if there are still any tasks on the cfs_rq? That way there'd only be a
> penalty on cgroup destruction, which is a much rarer operation.

No, that's broken! That would mean userspace gets the cgroup-empty
notification thing and then encounters -EBUSY, which then forces it to
go poll the state, rendering the whole notification thing pointless.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at