On Thu, 12.08.10 12:21, Paul Menage ([email protected]) wrote:

> 
> On Thu, Aug 12, 2010 at 12:15 PM, Dhaval Giani <[email protected]> wrote:
> >
> > ok, so is there some way one can extend this functionality at a per
> > cgroup level?
> 
> No reason why not, if you really wanted to. If you were going to put
> work into this though, it might be better to spend it on a
> netlink-like solution as len suggested. Or perhaps make use of the
> event notifiers that were added to cgroups a while ago? Have the
> notify_on_release file trigger a notification if the cgroup is empty?

The cgroup event notifiers look incredibly ugly to me. Echoing fds into
virtual files is just awful API. I'd very much prefer if people would
stop adding horrible APIs like that.

If all that matters is change notification I'd much rather ask people to
follow the scheme that is used for /proc/mounts change notification:
issue POLLERR when you poll() on it whenever a mount comes and
goes. It's much simpler, and although not the prettiest API in the world
either it is certainly a lot less ugly than echoing fds into virtual
files.

And if POLLERR is not liked, then another option would be to generate
inotify events for these files. 

In fact, almost everything is better than echoing fds into files and
spawning processes for each event. ;-)

In this case we want more than simple change notification: we want fully
recursive notifications, and I believe that netlink is by far the most
useful interface for this.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to