Commit 712e3517 authored by Roman Gushchin's avatar Roman Gushchin Committed by Tejun Heo

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: default avatarRoman Gushchin <guro@fb.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 5313bfe4
...@@ -28,12 +28,15 @@ extern void __init enable_debug_cgroup(void); ...@@ -28,12 +28,15 @@ extern void __init enable_debug_cgroup(void);
#define TRACE_CGROUP_PATH(type, cgrp, ...) \ #define TRACE_CGROUP_PATH(type, cgrp, ...) \
do { \ do { \
if (trace_cgroup_##type##_enabled()) { \ 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, \ cgroup_path(cgrp, trace_cgroup_path, \
TRACE_CGROUP_PATH_LEN); \ TRACE_CGROUP_PATH_LEN); \
trace_cgroup_##type(cgrp, trace_cgroup_path, \ trace_cgroup_##type(cgrp, trace_cgroup_path, \
##__VA_ARGS__); \ ##__VA_ARGS__); \
spin_unlock(&trace_cgroup_path_lock); \ spin_unlock_irqrestore(&trace_cgroup_path_lock, \
flags); \
} \ } \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment