]> git.ipfire.org Git - thirdparty/lxc.git/commit
mutex cgmanager access
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 20 Mar 2014 04:55:00 +0000 (23:55 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 21 Mar 2014 14:51:36 +0000 (10:51 -0400)
commit79bff4f8862e119b2bb672b0649c73b7f3681291
tree000e29a7eac1ff04395c9e6bdf2637954651f6da
parent23e880832b90190563b01fdd73fdcd5948492e52
mutex cgmanager access

It looks like either libdbus or libnih is showing some corruption with
threaded access to the cgmanager-client library.  Until we can
straighten that out, mutex access to the cgmanager.

The worst part of this is having to take and drop the mutex at every
fork.  This also means that we can't keep a connection open for the
duration of container startup, since that would deadlock forks.

If we were going to keep it like this, then we could get rid of some
code in start.c.  However we take a performance hit here which I
really hope we can rectify soon.

The other approach we could take would be to keep a global count of
references to cgroup_manager.  Mutex the open, close, and each use
of the cgroup_manager proxy (and the inc/dec of the refcount).  This
way we could in fact keep the connection open for the duration of
container start.  The atfork handler child_fn would have to close
the connection if open.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/cgmanager.c