diff options
author | Tejun Heo <tj@kernel.org> | 2022-10-28 22:45:44 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2022-10-28 22:46:17 +0200 |
commit | 6ab428604f724cf217a47b7d3f3353aab815b40e (patch) | |
tree | 1fa2bdbf4d3b77464915a7a0aee901ef49d6b7dc /kernel/cgroup | |
parent | blkcg: Update MAINTAINERS entry (diff) | |
download | linux-6ab428604f724cf217a47b7d3f3353aab815b40e.tar.xz linux-6ab428604f724cf217a47b7d3f3353aab815b40e.zip |
cgroup: Implement DEBUG_CGROUP_REF
It's really difficult to debug when cgroup or css refs leak. Let's add a
debug option to force the refcnt function to not be inlined so that they can
be kprobed for debugging.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup')
-rw-r--r-- | kernel/cgroup/cgroup.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index d922773fa90b..f786c4c973a0 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -248,6 +248,11 @@ static int cgroup_addrm_files(struct cgroup_subsys_state *css, struct cgroup *cgrp, struct cftype cfts[], bool is_add); +#ifdef CONFIG_DEBUG_CGROUP_REF +#define CGROUP_REF_FN_ATTRS noinline +#include <linux/cgroup_refcnt.h> +#endif + /** * cgroup_ssid_enabled - cgroup subsys enabled test by subsys ID * @ssid: subsys ID of interest |