lkml.org 
[lkml]   [2010]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/3] memcg: oom wakeup filter
    On Fri, 12 Mar 2010 14:31:37 +0900
    KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

    > +static int memcg_oom_wake_function(wait_queue_t *wait,
    > + unsigned mode, int sync, void *arg)
    > +{
    > + struct mem_cgroup *wake_mem = (struct mem_cgroup *)arg;
    > + struct oom_wait_info *oom_wait_info;
    > +
    > + /* both of oom_wait_info->mem and wake_mem are stable under us */
    > + oom_wait_info = container_of(wait, struct oom_wait_info, wait);
    > +
    > + if (oom_wait_info->mem == wake_mem)
    > + goto wakeup;
    > + /* if no hierarchy, no match */
    > + if (!oom_wait_info->mem->use_hierarchy || !wake_mem->use_hierarchy)
    > + return 0;
    > + /* check hierarchy */
    > + if (!css_is_ancestor(&oom_wait_info->mem->css, &wake_mem->css) &&
    > + !css_is_ancestor(&wake_mem->css, &oom_wait_info->mem->css))
    > + return 0;
    > +
    > +wakeup:
    > + return autoremove_wake_function(wait, mode, sync, arg);
    > +}

    What are the locking rules for calling css_is_ancestor()?


    \
     
     \ /
      Last update: 2010-03-15 22:53    [W:0.020 / U:0.840 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site