Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757097Ab3DAFDv (ORCPT ); Mon, 1 Apr 2013 01:03:51 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:51327 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757063Ab3DAFDu (ORCPT ); Mon, 1 Apr 2013 01:03:50 -0400 X-SecurityPolicyCheck: OK by SHieldMailChecker v1.8.4 Message-ID: <5159151E.9070204@jp.fujitsu.com> Date: Mon, 01 Apr 2013 14:03:26 +0900 From: Kamezawa Hiroyuki User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Li Zefan CC: Glauber Costa , Michal Hocko , Johannes Weiner , LKML , Cgroups , linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH] memcg: take reference before releasing rcu_read_lock References: <51556CE9.9060000@huawei.com> In-Reply-To: <51556CE9.9060000@huawei.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 707 Lines: 19 (2013/03/29 19:28), 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(). > > Signed-off-by: Li Zefan Acked-by: KAMEZAWA Hiroyuki -- 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/