Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757196Ab3DAHXc (ORCPT ); Mon, 1 Apr 2013 03:23:32 -0400 Received: from mx2.parallels.com ([199.115.105.18]:46412 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756975Ab3DAHXb (ORCPT ); Mon, 1 Apr 2013 03:23:31 -0400 Message-ID: <5159361D.40302@parallels.com> Date: Mon, 1 Apr 2013 11:24:13 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: Li Zefan CC: Michal Hocko , KAMEZAWA Hiroyuki , Johannes Weiner , LKML , Cgroups , , Andrew Morton Subject: Re: [PATCH] memcg: take reference before releasing rcu_read_lock References: <51556CE9.9060000@huawei.com> <5155718A.90108@parallels.com> <51563336.701@huawei.com> In-Reply-To: <51563336.701@huawei.com> Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1005 Lines: 25 On 03/30/2013 04:35 AM, Li Zefan wrote: > On 2013/3/29 18:48, Glauber Costa wrote: >> On 03/29/2013 02:28 PM, Li Zefan wrote: >>> The memcg is not referenced, so it can be destroyed at anytime right >>> after we exit rcu read section, so it's not safe to access it. >>> >>> To fix this, we call css_tryget() to get a reference while we're still >>> in rcu read section. >>> >>> This also removes a bogus comment above __memcg_create_cache_enqueue(). >>> >> Out of curiosity, did you see that happening ? >> > > Just by code inspection. This is not the only place you use RCU in this > wrong way. Remember the last patch I sent? ;) > Indeed, that is what happens with miscomprehensions: the mistake tends to be repeated. Thanks for your diligence with this. -- 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/