]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: call subsys->*attach() only for subsystems which are actually affected by...
authorTejun Heo <tj@kernel.org>
Mon, 16 Jan 2017 00:03:41 +0000 (19:03 -0500)
committerTejun Heo <tj@kernel.org>
Mon, 16 Jan 2017 00:03:41 +0000 (19:03 -0500)
commite490833cbe37d6938122fd76ab264fd0ccb97dda
tree90a4aa59cd98d338cf98cd38a94f4bf1b3abec60
parent144cd95a6a8ddb2b3438ae6d4cc52e7906f7dee0
cgroup: call subsys->*attach() only for subsystems which are actually affected by migration

Currently, subsys->*attach() callbacks are called for all subsystems
which are attached to the hierarchy on which the migration is taking
place.

With cgroup_migrate_prepare_dst() filtering out identity migrations,
v1 hierarchies can avoid spurious ->*attach() callback invocations
where the source and destination csses are identical; however, this
isn't enough on v2 as only a subset of the attached controllers can be
affected on controller enable/disable.

While spurious ->*attach() invocations aren't critically broken,
they're unnecessary overhead and can lead to temporary overcharges on
certain controllers.  Fix it by tracking which subsystems are affected
by a migration and invoking ->*attach() callbacks only on those
subsystems.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Zefan Li <lizefan@huawei.com>
kernel/cgroup/cgroup-internal.h
kernel/cgroup/cgroup-v1.c
kernel/cgroup/cgroup.c