Michal Koutný 9c974c7724 cgroup: Iterate tasks that did not finish do_exit()
PF_EXITING is set earlier than actual removal from css_set when a task
is exitting. This can confuse cgroup.procs readers who see no PF_EXITING
tasks, however, rmdir is checking against css_set membership so it can
transitionally fail with EBUSY.

Fix this by listing tasks that weren't unlinked from css_set active
lists.
It may happen that other users of the task iterator (without
CSS_TASK_ITER_PROCS) spot a PF_EXITING task before cgroup_exit(). This
is equal to the state before commit c03cd7738a83 ("cgroup: Include dying
leaders with live threads in PROCS iterations") but it may be reviewed
later.

Reported-by: Suren Baghdasaryan <surenb@google.com>
Fixes: c03cd7738a83 ("cgroup: Include dying leaders with live threads in PROCS iterations")
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2020-02-12 17:02:53 -05:00
..
2020-02-09 12:11:12 -08:00
2019-11-27 11:42:01 -08:00
2020-02-11 16:39:18 -08:00
2019-12-18 18:07:31 +01:00
2019-07-08 18:55:42 -07:00
2019-07-08 18:55:42 -07:00
2020-01-03 11:17:14 -08:00
2020-01-29 19:56:50 -08:00
2020-01-09 13:23:40 +01:00
2020-02-09 16:05:50 -08:00
2019-12-04 19:44:14 -08:00
2020-01-08 16:32:55 +00:00
2019-05-24 20:16:01 +02:00
2020-01-14 12:20:48 +01:00
2019-12-11 16:37:02 +08:00
2020-01-13 21:49:36 +01:00
2019-12-04 15:18:39 +01:00
2019-12-18 18:07:31 +01:00
2019-07-08 19:36:47 -07:00
2019-07-08 19:36:47 -07:00