mirror of
https://github.com/brain-hackers/linux-brain.git
synced 2024-06-09 23:36:23 +09:00
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>
This commit is contained in:
parent
5313bfe425
commit
712e351787
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user