summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup/cgroup-internal.h
diff options
context:
space:
mode:
authorRoman Gushchin2019-04-19 19:03:07 +0200
committerTejun Heo2019-04-19 20:26:49 +0200
commit712e35178754bbb785d00d5fcf5abaf32699bf11 (patch)
tree8d6e3db1624240797389574e0a5f62b4df2521d4 /kernel/cgroup/cgroup-internal.h
parentkselftests: cgroup: add freezer controller self-tests (diff)
downloadkernel-qcow2-linux-712e35178754bbb785d00d5fcf5abaf32699bf11.tar.gz
kernel-qcow2-linux-712e35178754bbb785d00d5fcf5abaf32699bf11.tar.xz
kernel-qcow2-linux-712e35178754bbb785d00d5fcf5abaf32699bf11.zip
cgroup: make TRACE_CGROUP_PATH irq-safe
To use the TRACE_CGROUP_PATH() macro with css_set_lock locked, let's make the macro irq-safe. It's necessary in order to trace cgroup freezer state transitions (frozen/not frozen), which are happening with css_set_lock locked. Signed-off-by: Roman Gushchin <guro@fb.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup/cgroup-internal.h')
-rw-r--r--kernel/cgroup/cgroup-internal.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h
index 02c001ffe2e2..809e34a3c017 100644
--- a/kernel/cgroup/cgroup-internal.h
+++ b/kernel/cgroup/cgroup-internal.h
@@ -28,12 +28,15 @@ extern void __init enable_debug_cgroup(void);
#define TRACE_CGROUP_PATH(type, cgrp, ...) \
do { \
if (trace_cgroup_##type##_enabled()) { \
- spin_lock(&trace_cgroup_path_lock); \
+ unsigned long flags; \
+ spin_lock_irqsave(&trace_cgroup_path_lock, \
+ flags); \
cgroup_path(cgrp, trace_cgroup_path, \
TRACE_CGROUP_PATH_LEN); \
trace_cgroup_##type(cgrp, trace_cgroup_path, \
##__VA_ARGS__); \
- spin_unlock(&trace_cgroup_path_lock); \
+ spin_unlock_irqrestore(&trace_cgroup_path_lock, \
+ flags); \
} \
} while (0)