From: "Kirill A. Shutemov" <kirill-oKw7cIdHH8eLwutG50LtGA@public.gmane.org>
To: "Víctor Fernández Martínez"
<vfernandez-JE8hqn47KVKB+jHODAdFcQ@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Getting notifications of the tasks file
Date: Tue, 31 Jul 2012 17:14:13 +0300 [thread overview]
Message-ID: <20120731141413.GA3200@shutemov.name> (raw)
In-Reply-To: <5486539.IgfTNnpt1m@valencia>
On Tue, Jul 31, 2012 at 11:42:06AM +0200, Víctor Fernández Martínez wrote:
> I'm trying to use the eventfd notification API to get notified when the tasks
> file changes. This way I would like to know when child processes are spawned
> and when they exit. However, I always get EINVAL when writing to
> cgroup.event_control. Even cgroup_event_listener.c returns that error:
>
> # cat /sys/fs/cgroup/memory/grp0/tasks
> 3590
> 23902
> # ./cgroup_event_listener /sys/fs/cgroup/memory/grp0/tasks 0
> Cannot write to cgroup.event_control: Invalid argument
>
> I have also tried to monitor cgroup.procs.
>
> Is it possible to monitor the tasks file at all or is this a bug? If 0 is a
> wrong argument, which argument should I use instead?
Currently, you can only listen for events from memory.usage_in_bytes,
memory.memsw.usage_in_bytes and memory.oom_control.
It's not implemented for any other cgroup files yet.
--
Kirill A. Shutemov
next prev parent reply other threads:[~2012-07-31 14:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-31 9:42 Getting notifications of the tasks file Víctor Fernández Martínez
2012-07-31 14:14 ` Kirill A. Shutemov [this message]
2012-08-07 11:33 ` Zhu Yanhai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120731141413.GA3200@shutemov.name \
--to=kirill-okw7cidhh8elwutg50ltga@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=vfernandez-JE8hqn47KVKB+jHODAdFcQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox