lkml.org 
[lkml]   [2011]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v3 6/7] tcp buffer limitation: per-cgroup limit
    On Sun, Sep 18, 2011 at 5:56 PM, Glauber Costa <glommer@parallels.com> wrote:
    > +static inline bool mem_cgroup_is_root(struct mem_cgroup *mem)
    > +{
    > +       return (mem == root_mem_cgroup);
    > +}
    > +

    Why are you adding a copy of mem_cgroup_is_root(). I see one already
    in v3.0. Was it deleted in a previous patch?

    > +static int tcp_write_maxmem(struct cgroup *cgrp, struct cftype *cft, u64 val)
    > +{
    > +       struct mem_cgroup *sg = mem_cgroup_from_cont(cgrp);
    > +       struct mem_cgroup *parent = parent_mem_cgroup(sg);
    > +       struct net *net = current->nsproxy->net_ns;
    > +       int i;
    > +
    > +       if (!cgroup_lock_live_group(cgrp))
    > +               return -ENODEV;

    Why is cgroup_lock_live_cgroup() needed here? Does it protect updates
    to sg->tcp_prot_mem[*]?

    > +static u64 tcp_read_maxmem(struct cgroup *cgrp, struct cftype *cft)
    > +{
    > +       struct mem_cgroup *sg = mem_cgroup_from_cont(cgrp);
    > +       u64 ret;
    > +
    > +       if (!cgroup_lock_live_group(cgrp))
    > +               return -ENODEV;

    Why is cgroup_lock_live_cgroup() needed here? Does it protect updates
    to sg->tcp_max_memory?
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2011-09-22 08:05    [W:4.098 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site