cgroup: freezer: don't change task and cgroups status unnecessarily
authorHonglei Wang <honglei.wang@oracle.com>
Wed, 30 Oct 2019 08:18:10 +0000 (16:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:45:06 +0000 (16:45 +0100)
commit20832ebf91a654579c029ae627b961137ad47b1a
tree13c1c5392b7e62375848319236fb62ad4749df0a
parent2170f9d296c87f702391fb5614e08f67632a4cd6
cgroup: freezer: don't change task and cgroups status unnecessarily

[ Upstream commit 742e8cd3e1ba6f19cad6d912f8d469df5557d0fd ]

It's not necessary to adjust the task state and revisit the state
of source and destination cgroups if the cgroups are not in freeze
state and the task itself is not frozen.

And in this scenario, it wakes up the task who's not supposed to be
ready to run.

Don't do the unnecessary task state adjustment can help stop waking
up the task without a reason.

Signed-off-by: Honglei Wang <honglei.wang@oracle.com>
Acked-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/cgroup/freezer.c