The problem is, forks can happen at any time, so there's no way to preventforks from happening while iterating tasks in a cgroup, so controllershave to deal with it. In fact freezer is somewhat aware of this issue,that's why it provides the ->fork callback, but there's race.

This patch is not too bad (needs a bit modification). cgroup core will detect(via seqcount) if something's happened to a cgroup and the tasks in it, andthen cgroup will notify controllers to check if newly-forked tasks shouldbe adjusted accordingly, so they will have consistent status with other tasksin the same cgroup.