cgroup: Remove redundant code that handles zombie tasks

Zombie tasks are dumped in dump_zombies() so it is redundant to handle them
in dump_one_task().

Deprecate cg_set in task_core_entry as this field must be per thread now.

Signed-off-by: Bui Quang Minh <minhquangbui99@gmail.com>
This commit is contained in:
Bui Quang Minh 2022-11-03 22:04:53 +07:00 committed by Andrei Vagin
parent c1ae880eb4
commit f5e0f641a8
3 changed files with 6 additions and 11 deletions

View file

@ -811,16 +811,7 @@ static int dump_task_core_all(struct parasite_ctl *ctl, struct pstree_item *item
goto err;
}
/*
* We don't support multithreads zombie tasks so there is
* no thread_core in zombie tasks, store the cg_set in
* task_core in these cases.
*/
cg_set = &core->thread_core->cg_set;
if (item->pid->state == TASK_THREAD) {
core->tc->has_cg_set = true;
cg_set = &core->tc->cg_set;
}
ret = dump_thread_cgroup(item, cg_set, info, -1);
if (ret)
goto err;

View file

@ -1350,9 +1350,12 @@ static inline int fork_with_pid(struct pstree_item *item)
item->pid->state = ca.core->tc->task_state;
/* Zombie task's cg_set is stored in task_core */
/*
* Zombie tasks' cgroup is not dumped/restored.
* cg_set == 0 is skipped in prepare_task_cgroup()
*/
if (item->pid->state == TASK_DEAD)
rsti(item)->cg_set = ca.core->tc->cg_set;
rsti(item)->cg_set = 0;
else
rsti(item)->cg_set = ca.core->thread_core->cg_set;

View file

@ -40,6 +40,7 @@ message task_core_entry {
optional task_timers_entry timers = 7;
optional task_rlimits_entry rlimits = 8;
/* This is deprecated, should be per-thread */
optional uint32 cg_set = 9;
optional signal_queue_entry signals_s = 10;