Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759585AbZAHK7f (ORCPT ); Thu, 8 Jan 2009 05:59:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754535AbZAHK7L (ORCPT ); Thu, 8 Jan 2009 05:59:11 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:40140 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbZAHK7J (ORCPT ); Thu, 8 Jan 2009 05:59:09 -0500 Message-ID: <36699.10.75.179.62.1231412340.squirrel@webmail-b.css.fujitsu.com> In-Reply-To: <20090108191430.af89e037.nishimura@mxp.nes.nec.co.jp> References: <20090108190818.b663ce20.nishimura@mxp.nes.nec.co.jp> <20090108191430.af89e037.nishimura@mxp.nes.nec.co.jp> Date: Thu, 8 Jan 2009 19:59:00 +0900 (JST) Subject: Re: [RFC][PATCH 1/4] memcg: fix formem_cgroup_get_reclaim_stat_from_page From: "KAMEZAWA Hiroyuki" To: "Daisuke Nishimura" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kamezawa.hiroyu@jp.fujitsu.com, balbir@linux.vnet.ibm.com, lizf@cn.fujitsu.com, menage@google.com, nishimura@mxp.nes.nec.co.jp User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=us-ascii Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2009 Lines: 58 Daisuke Nishimura said: > Call Trace: > [] ? ____pagevec_lru_add+0xc1/0x13c > [] ? drain_cpu_pagevecs+0x36/0x89 > [] ? swapin_readahead+0x78/0x98 > [] ? handle_mm_fault+0x3d9/0x741 > [] ? do_page_fault+0x3ce/0x78c > [] ? trace_hardirqs_off_thunk+0x3a/0x3c > [] ? page_fault+0x1f/0x30 > Code: cc 55 48 8d af b8 0d 00 00 48 89 f7 53 89 d3 e8 39 85 02 00 48 > 63 d3 48 ff 44 d5 10 45 85 e4 74 05 48 ff 44 d5 00 48 85 c0 74 0e <48> > ff 44 d0 10 45 85 e4 74 04 48 ff 04 d0 5b 5d 41 5c c3 41 54 > RIP [] update_page_reclaim_stat+0x2f/0x42 > RSP > > > Signed-off-by: Daisuke Nishimura yes. PageCgroupUsed() should be cheked. or list_empty(&pc->lru) should be checked under zone->lock. Your fix seems reasonable. Acked-by: KAMEZAWA Hiroyuki > --- > mm/memcontrol.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index e2996b8..62e69d8 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -559,6 +559,10 @@ mem_cgroup_get_reclaim_stat_from_page(struct page > *page) > return NULL; > > pc = lookup_page_cgroup(page); > + smp_rmb(); > + if (!PageCgroupUsed(pc)) > + return NULL; > + > mz = page_cgroup_zoneinfo(pc); > if (!mz) > return NULL; > -- > 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/ > -- 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/