From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752750Ab1IZWuY (ORCPT ); Mon, 26 Sep 2011 18:50:24 -0400 Received: from mx2.parallels.com ([64.131.90.16]:34458 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752396Ab1IZWuW (ORCPT ); Mon, 26 Sep 2011 18:50:22 -0400 Message-ID: <4E810187.3000106@parallels.com> Date: Mon, 26 Sep 2011 19:49:43 -0300 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: KAMEZAWA Hiroyuki CC: Greg Thelen , , , , , , , , Subject: Re: [PATCH v3 6/7] tcp buffer limitation: per-cgroup limit References: <1316393805-3005-1-git-send-email-glommer@parallels.com> <1316393805-3005-7-git-send-email-glommer@parallels.com> <4E7DDB82.3030802@parallels.com> <20110926200247.c80f7e47.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20110926200247.c80f7e47.kamezawa.hiroyu@jp.fujitsu.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [201.82.135.174] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/26/2011 08:02 AM, KAMEZAWA Hiroyuki wrote: > On Sat, 24 Sep 2011 10:30:42 -0300 > Glauber Costa wrote: > >> On 09/22/2011 03:01 AM, Greg Thelen wrote: >>> On Sun, Sep 18, 2011 at 5:56 PM, Glauber Costa 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? >> >> Already answered by another good samaritan. >> >>>> +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? >> >> No, that is not my understanding. My understanding is this lock is >> needed to protect against the cgroup just disappearing under our nose. >> > > Hm. reference count of dentry for cgroup isn't enough ? > > Thanks, > -Kame > think think think think think think... Yeah, I guess it is.