From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751113AbXBUEtw (ORCPT ); Tue, 20 Feb 2007 23:49:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751116AbXBUEtw (ORCPT ); Tue, 20 Feb 2007 23:49:52 -0500 Received: from ns.suse.de ([195.135.220.2]:49951 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbXBUEtv (ORCPT ); Tue, 20 Feb 2007 23:49:51 -0500 From: Nick Piggin To: Linux Memory Management , Andrew Morton Cc: Linux Kernel , Nick Piggin , Benjamin Herrenschmidt Message-Id: <20070221023706.6306.55204.sendpatchset@linux.site> In-Reply-To: <20070221023656.6306.246.sendpatchset@linux.site> References: <20070221023656.6306.246.sendpatchset@linux.site> Subject: [patch 1/6] mm: debug check for the fault vs invalidate race Date: Wed, 21 Feb 2007 05:49:47 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Add a bugcheck for Andrea's pagefault vs invalidate race. This is triggerable for both linear and nonlinear pages with a userspace test harness (using direct IO and truncate, respectively). Signed-off-by: Nick Piggin mm/filemap.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6/mm/filemap.c =================================================================== --- linux-2.6.orig/mm/filemap.c +++ linux-2.6/mm/filemap.c @@ -120,6 +120,8 @@ void __remove_from_page_cache(struct pag page->mapping = NULL; mapping->nrpages--; __dec_zone_page_state(page, NR_FILE_PAGES); + + BUG_ON(page_mapped(page)); } void remove_from_page_cache(struct page *page) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Message-Id: <20070221023706.6306.55204.sendpatchset@linux.site> In-Reply-To: <20070221023656.6306.246.sendpatchset@linux.site> References: <20070221023656.6306.246.sendpatchset@linux.site> Subject: [patch 1/6] mm: debug check for the fault vs invalidate race Date: Wed, 21 Feb 2007 05:49:47 +0100 (CET) Sender: owner-linux-mm@kvack.org Return-Path: To: Linux Memory Management , Andrew Morton Cc: Linux Kernel , Nick Piggin , Benjamin Herrenschmidt List-ID: Add a bugcheck for Andrea's pagefault vs invalidate race. This is triggerable for both linear and nonlinear pages with a userspace test harness (using direct IO and truncate, respectively). Signed-off-by: Nick Piggin mm/filemap.c | 2 ++ 1 file changed, 2 insertions(+) Index: linux-2.6/mm/filemap.c =================================================================== --- linux-2.6.orig/mm/filemap.c +++ linux-2.6/mm/filemap.c @@ -120,6 +120,8 @@ void __remove_from_page_cache(struct pag page->mapping = NULL; mapping->nrpages--; __dec_zone_page_state(page, NR_FILE_PAGES); + + BUG_ON(page_mapped(page)); } void remove_from_page_cache(struct page *page) -- 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