- Jan 16, 2017
-
-
Tejun Heo authored
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>
-
Tejun Heo authored
cgroup migration is performed in four steps - css_set preloading, addition of target tasks, actual migration, and clean up. A list named preloaded_csets is used to track the preloading. This is a bit too restricted and the code is already depending on the subtlety that all source css_sets appear before destination ones. Let's create struct cgroup_mgctx which keeps track of everything during migration. Currently, it has separate preload lists for source and destination csets and also embeds cgroup_taskset which is used during the actual migration. This moves struct cgroup_taskset definition to cgroup-internal.h. This patch doesn't cause any functional changes. Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
Zefan Li <lizefan@huawei.com>
-
Tejun Heo authored
cgroup_taskset_add() was using list_add_tail() when for source csets but list_move_tail() for destination. As the operations are gated by list_empty() test, list_move_tail() is equivalent to list_add_tail() here. Use list_add_tail() too for destination csets too. This doesn't cause any functional changes. Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
Zefan Li <lizefan@huawei.com>
-
- Dec 27, 2016
-
-
Tejun Heo authored
kn->priv which is a void * is used as a RCU pointer by cgroup. When dereferencing it, it was passing kn->priv to rcu_derefreence() without casting it into a RCU pointer triggering address space mismatch warning from sparse. Fix them. Signed-off-by:
Tejun Heo <tj@kernel.org> Reported-by:
Fengguang Wu <fengguang.wu@intel.com> Acked-by:
Acked-by: Zefan Li <lizefan@huawei.com>
-
Tejun Heo authored
get/put_css_set() get exposed in cgroup-internal.h in the process. Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
Acked-by: Zefan Li <lizefan@huawei.com>
-
Tejun Heo authored
Now that v1 functions are separated out, rename some functions for consistency. cgroup_dfl_base_files -> cgroup_base_files cgroup_legacy_base_files -> cgroup1_base_files cgroup_ssid_no_v1() -> cgroup1_ssid_disabled() cgroup_pidlist_destroy_all -> cgroup1_pidlist_destroy_all() cgroup_release_agent() -> cgroup1_release_agent() check_for_release() -> cgroup1_check_for_release() Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
Acked-by: Zefan Li <lizefan@huawei.com>
-
Tejun Heo authored
Now that the v1 mount code is split into separate functions, move them to kernel/cgroup/cgroup-v1.c along with the mount option handling code. As this puts all v1-only kernfs_syscall_ops in cgroup-v1.c, move cgroup1_kf_syscall_ops to cgroup-v1.c too. Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
Acked-by: Zefan Li <lizefan@huawei.com>
-
Tejun Heo authored
Currently, cgroup_kf_syscall_ops is shared by v1 and v2 and the specific methods test the version and take different actions. Split out v1 functions and put them in cgroup1_kf_syscall_ops and remove the now unnecessary explicit branches in specific methods. Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
Acked-by: Zefan Li <lizefan@huawei.com>
-
Tejun Heo authored
While sharing some mechanisms, the mount paths of v1 and v2 are substantially different. Their implementations were mixed in cgroup_mount(). This patch splits them out so that they're easier to follow and organize. This patch causes one functional change - the WARN_ON(new_sb) gets lost. This is because the actual mounting gets moved to cgroup_do_mount() and thus @new_sb is no longer accessible by default to cgroup1_mount(). While we can add it as an explicit out parameter to cgroup_do_mount(), this part of code hasn't changed and the warning hasn't triggered for quite a while. Dropping it should be fine. Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
Acked-by: Zefan Li <lizefan@huawei.com>
-
Tejun Heo authored
cgroup.c is getting too unwieldy. Let's move out cgroup v1 specific code along with the debug controller into kernel/cgroup/cgroup-v1.c. v2: cgroup_mutex and css_set_lock made available in cgroup-internal.h regardless of CONFIG_PROVE_RCU. Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
Acked-by: Zefan Li <lizefan@huawei.com>
-
Tejun Heo authored
They're growing to be too many and planned to get split further. Move them under their own directory. kernel/cgroup.c -> kernel/cgroup/cgroup.c kernel/cgroup_freezer.c -> kernel/cgroup/freezer.c kernel/cgroup_pids.c -> kernel/cgroup/pids.c kernel/cpuset.c -> kernel/cgroup/cpuset.c Signed-off-by:
Tejun Heo <tj@kernel.org> Acked-by:
Acked-by: Zefan Li <lizefan@huawei.com>
-