Skip to contentSkip to conversation

Getting a process cgroup's path without sleeping

DISCUSSION Nikolay Borisov 1 participant 1 message May 20, 2015 cgroup

lore
Share & tools
lore
#0 lore raw

Hello list,

I'm currently working on a modification to the kernel and I need to query if the current is in the root cgroup or not. This can easily be achieved by using task_cgroup_path, however it acquires cgroup_mutex which can sleep. Unfortunately my usecase involves calling task_cgroup_path in rcu read-side critical section and as you can imagine this makes the RCU lock checking code to splat.

So my question is how to be able to safely get the cgroup path of the current process (or any process) under rcu read side critical sections e.g. not having to acquire the cgroup_mutex?

Regards,
Nikolay