summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2022-10-28 22:45:44 +0200
committerTejun Heo <tj@kernel.org>2022-10-28 22:46:17 +0200
commit6ab428604f724cf217a47b7d3f3353aab815b40e (patch)
tree1fa2bdbf4d3b77464915a7a0aee901ef49d6b7dc /kernel/cgroup
parentblkcg: Update MAINTAINERS entry (diff)
downloadlinux-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.c5
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