From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx193.postini.com [74.125.245.193]) by kanga.kvack.org (Postfix) with SMTP id 138FE6B005A for ; Mon, 29 Oct 2012 10:06:45 -0400 (EDT) Message-ID: <508E8D6A.5040602@parallels.com> Date: Mon, 29 Oct 2012 18:06:34 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v3 4/6] cgroups: forbid pre_destroy callback to fail References: <1351251453-6140-1-git-send-email-mhocko@suse.cz> <1351251453-6140-5-git-send-email-mhocko@suse.cz> <508E8CDE.1090702@parallels.com> In-Reply-To: <508E8CDE.1090702@parallels.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , Tejun Heo , Li Zefan , Johannes Weiner , KAMEZAWA Hiroyuki , Balbir Singh On 10/29/2012 06:04 PM, Glauber Costa wrote: > On 10/26/2012 03:37 PM, Michal Hocko wrote: >> Now that mem_cgroup_pre_destroy callback doesn't fail (other than a race >> with a task attach resp. child group appears) finally we can safely move >> on and forbit all the callbacks to fail. >> The last missing piece is moving cgroup_call_pre_destroy after >> cgroup_clear_css_refs so that css_tryget fails so no new charges for the >> memcg can happen. >> We cannot, however, move cgroup_call_pre_destroy right after because we >> cannot call mem_cgroup_pre_destroy with the cgroup_lock held (see >> 3fa59dfb cgroup: fix potential deadlock in pre_destroy) so we have to >> move it after the lock is released. >> > > If we don't have the cgroup lock held, how safe is the following > statement in mem_cgroup_reparent_charges(): > > if (cgroup_task_count(cgrp) || !list_empty(&cgrp->children)) > return -EBUSY; > > ? > > IIUC, although this is not generally safe, but it would be safe here > because at this point we are expected to had already set the removed bit > in the css. If this is the case, however, this condition is impossible > and becomes useless - in which case you may want to remove it from Patch1. > Which I just saw you doing in patch5... =) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org