lkml.org 
[lkml]   [2009]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 1/1] Memory usage limit notification addition to memcg
    Date
    > On Tue, Jul 7, 2009 at 5:56 PM, KAMEZAWA
    > Hiroyuki<kamezawa.hiroyu@jp.fujitsu.com> wrote:
    > >
    > > I know people likes to wait for file descriptor to get notification in these days.
    > > Can't we have "event" file descriptor in cgroup layer and make it reusable for
    > > other purposes ?
    >
    > I agree - rather than having to add a separate "wait for value to
    > cross X threshold" file for each numeric usage value that people might
    > be concerned about, it would be better to have a generic way to do it
    > for any file. Given that this is a userspace API, it would be better
    > to work out at least the generic API first, even if the initial
    > implementation isn't generic.
    >
    > Properties that it should support include:
    >
    > - notification when a value crosses above or below a given threshold
    > (which would include binary cases such as OOM notification where the
    > value cross from "not-OOM" to "OOM"
    >
    > - independent thresholds for different waiters
    >
    > - epoll support (by using eventfd?)

    signalfd?


    > - automatic wakeup when a cgroup is removed
    >
    > - maybe optional wakeup when a thread attach occurs?
    >
    > - not require more than read permissions on the file containing the
    > value being monitored
    >
    > I guess there are a few possible ways this could be exposed to userspace:
    >
    > 1) new ioctl on cgroups files. simple but probably not popular
    >
    > 2) new system call. maybe the cleanest, but involves changing every
    > arch and is hard to script
    >
    > 3) new per-cgroup file to control these e.g:
    > - create an eventfd
    > - open the control file to be monitored
    > - write the "<event_fd>, <control_fd> <threshold> to
    > cgroup.event_control to link them together
    > flexible and scriptable but maybe a clumsy interface in general

    I like multiple threshold and per-thresold file-descriptor.
    it solve multiple waiters issue.

    but How about this?

    /cgroup
    /group1
    /notifications
    /threashold-A
    /threashold-B








    \
     
     \ /
      Last update: 2009-07-14 03:47    [W:0.027 / U:0.052 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site