From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753975Ab0IMRRu (ORCPT ); Mon, 13 Sep 2010 13:17:50 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:49280 "EHLO e5.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752521Ab0IMRRt (ORCPT ); Mon, 13 Sep 2010 13:17:49 -0400 Date: Mon, 13 Sep 2010 22:47:41 +0530 From: Balbir Singh To: Hiroyuki Kamezawa Cc: KAMEZAWA Hiroyuki , "linux-mm@kvack.org" , "nishimura@mxp.nes.nec.co.jp" , gthelen@google.com, "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , stable@kernel.org Subject: Re: [BUGFIX][PATCH] memcg: fix race in file_mapped accouting flag management Message-ID: <20100913171741.GM17950@balbir.in.ibm.com> Reply-To: balbir@linux.vnet.ibm.com References: <20100913160822.0c2cd732.kamezawa.hiroyu@jp.fujitsu.com> <20100913084741.GD17950@balbir.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Hiroyuki Kamezawa [2010-09-14 00:28:30]: > > In the situation above who has the PTE lock? Are we not synchronized > > via the PTE lock such that add rmap and rm rmap, will not happen > > simultaneously? > > > In this case, a process for map and one for unmap can be different. > > Assume process A maps a file cache and process B not. > While process A unmap a file, process B can map it. > pte lock is no help. > Correct, so while the accounting is correct, the flag can definitely go wrong. I misread your race description earlier. Thanks! -- Three Cheers, Balbir