Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a698b448 authored by Tejun Heo's avatar Tejun Heo
Browse files

cgroup: remove gratuituous BUG_ON()s from rebind_subsystems()



rebind_subsystems() performs santiy checks even on subsystems which
aren't specified to be added or removed and the checks aren't all that
useful given that these are in a very cold path while the violations
they check would trip up in much hotter paths.

Let's remove these from rebind_subsystems().

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarLi Zefan <lizefan@huawei.com>
parent 1d5be6b2
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1077,15 +1077,6 @@ static int rebind_subsystems(struct cgroupfs_root *root,
			/* subsystem is now free - drop reference on module */
			module_put(ss->module);
			root->subsys_mask &= ~bit;
		} else if (bit & root->subsys_mask) {
			/* Subsystem state should already exist */
			BUG_ON(!cgrp->subsys[i]);
#ifdef CONFIG_MODULE_UNLOAD
			BUG_ON(ss->module && !module_refcount(ss->module));
#endif
		} else {
			/* Subsystem state shouldn't exist */
			BUG_ON(cgrp->subsys[i]);
		}
	}