]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cgroup: make sure a parent css isn't freed before its children
authorTejun Heo <tj@kernel.org>
Thu, 21 Jan 2016 20:32:15 +0000 (15:32 -0500)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:22:01 +0000 (17:22 -0500)
commit5f8df046ced60b354c84d323c95af00b0aa5b9fb
tree98af40da970996e4d08812c92564e2b6a2d18cc0
parent96625a7f76a0e94641f6716e4f55863bdc91f0ac
cgroup: make sure a parent css isn't freed before its children

Orabug: 25308065

[ Upstream commit 8bb5ef79bc0f4016ecf79e8dce6096a3c63603e4 ]

There are three subsystem callbacks in css shutdown path -
css_offline(), css_released() and css_free().  Except for
css_released(), cgroup core didn't guarantee the order of invocation.
css_offline() or css_free() could be called on a parent css before its
children.  This behavior is unexpected and led to bugs in cpu and
memory controller.

The previous patch updated ordering for css_offline() which fixes the
cpu controller issue.  While there currently isn't a known bug caused
by misordering of css_free() invocations, let's fix it too for
consistency.

css_free() ordering can be trivially fixed by moving putting of the
parent css below css_free() invocation.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit cef12dbf18ab7617cacf7c271da43624afac5520)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
kernel/cgroup.c