From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754096Ab0DVX4J (ORCPT ); Thu, 22 Apr 2010 19:56:09 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:53460 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752090Ab0DVX4H (ORCPT ); Thu, 22 Apr 2010 19:56:07 -0400 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Date: Fri, 23 Apr 2010 08:52:03 +0900 From: KAMEZAWA Hiroyuki To: Christoph Lameter Cc: Mel Gorman , Minchan Kim , Andrew Morton , Andrea Arcangeli , Adam Litke , Avi Kivity , David Rientjes , KOSAKI Motohiro , Rik van Riel , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 04/14] mm,migration: Allow the migration of PageSwapCache pages Message-Id: <20100423085203.b43d1cb3.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: References: <20100421153421.GM30306@csn.ul.ie> <20100422092819.GR30306@csn.ul.ie> <20100422184621.0aaaeb5f.kamezawa.hiroyu@jp.fujitsu.com> <20100422193106.9ffad4ec.kamezawa.hiroyu@jp.fujitsu.com> <20100422195153.d91c1c9e.kamezawa.hiroyu@jp.fujitsu.com> <20100422141404.GA30306@csn.ul.ie> <20100422154003.GC30306@csn.ul.ie> <20100422192923.GH30306@csn.ul.ie> Organization: FUJITSU Co. LTD. X-Mailer: Sylpheed 3.0.2 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Apr 2010 14:40:46 -0500 (CDT) Christoph Lameter wrote: > On Thu, 22 Apr 2010, Mel Gorman wrote: > > > vma_adjust() is updating anon VMA information without any locks taken. > > In constract, file-backed mappings use the i_mmap_lock. This lack of > > locking can result in races with page migration. During rmap_walk(), > > vma_address() can return -EFAULT for an address that will soon be valid. > > This leaves a dangling migration PTE behind which can later cause a > > BUG_ON to trigger when the page is faulted in. > > Isnt this also a race with reclaim / swap? > Yes, it's also race in reclaim/swap ... page_referenced() try_to_unmap(). rmap_walk() <==== we hit this case. But above 2 are not considered to be critical. I'm not sure how this race affect KSM. Thanks, -Kame From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail144.messagelabs.com (mail144.messagelabs.com [216.82.254.51]) by kanga.kvack.org (Postfix) with SMTP id 3EA046B01F0 for ; Thu, 22 Apr 2010 19:56:08 -0400 (EDT) Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o3MNu5h5017639 for (envelope-from kamezawa.hiroyu@jp.fujitsu.com); Fri, 23 Apr 2010 08:56:05 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 383E245DE4E for ; Fri, 23 Apr 2010 08:56:05 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 1145F45DE58 for ; Fri, 23 Apr 2010 08:56:05 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id AD5F01DB8061 for ; Fri, 23 Apr 2010 08:56:04 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.249.87.105]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 39AAC1DB805F for ; Fri, 23 Apr 2010 08:56:04 +0900 (JST) Date: Fri, 23 Apr 2010 08:52:03 +0900 From: KAMEZAWA Hiroyuki Subject: Re: [PATCH 04/14] mm,migration: Allow the migration of PageSwapCache pages Message-Id: <20100423085203.b43d1cb3.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: References: <20100421153421.GM30306@csn.ul.ie> <20100422092819.GR30306@csn.ul.ie> <20100422184621.0aaaeb5f.kamezawa.hiroyu@jp.fujitsu.com> <20100422193106.9ffad4ec.kamezawa.hiroyu@jp.fujitsu.com> <20100422195153.d91c1c9e.kamezawa.hiroyu@jp.fujitsu.com> <20100422141404.GA30306@csn.ul.ie> <20100422154003.GC30306@csn.ul.ie> <20100422192923.GH30306@csn.ul.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: Christoph Lameter Cc: Mel Gorman , Minchan Kim , Andrew Morton , Andrea Arcangeli , Adam Litke , Avi Kivity , David Rientjes , KOSAKI Motohiro , Rik van Riel , linux-kernel@vger.kernel.org, linux-mm@kvack.org List-ID: On Thu, 22 Apr 2010 14:40:46 -0500 (CDT) Christoph Lameter wrote: > On Thu, 22 Apr 2010, Mel Gorman wrote: > > > vma_adjust() is updating anon VMA information without any locks taken. > > In constract, file-backed mappings use the i_mmap_lock. This lack of > > locking can result in races with page migration. During rmap_walk(), > > vma_address() can return -EFAULT for an address that will soon be valid. > > This leaves a dangling migration PTE behind which can later cause a > > BUG_ON to trigger when the page is faulted in. > > Isnt this also a race with reclaim / swap? > Yes, it's also race in reclaim/swap ... page_referenced() try_to_unmap(). rmap_walk() <==== we hit this case. But above 2 are not considered to be critical. I'm not sure how this race affect KSM. Thanks, -Kame -- 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