From mboxrd@z Thu Jan 1 00:00:00 1970 From: npiggin@suse.de Subject: [patch 05/41] mm: debug write deadlocks Date: Fri, 25 May 2007 22:21:49 +1000 Message-ID: <20070524053153.983797000@linux.local0.net> References: <20070524052844.860329000@suse.de> Cc: linux-fsdevel@vger.kernel.org, Mark Fasheh , Linux Memory Management To: Andrew Morton Return-path: Received: from cantor.suse.de ([195.135.220.2]:40192 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756577AbXEYMh0 (ORCPT ); Fri, 25 May 2007 08:37:26 -0400 Content-Disposition: inline; filename=mm-debug-write-deadlocks.patch Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Allow CONFIG_DEBUG_VM to switch off the prefaulting logic, to simulate the difficult race where the page may be unmapped before calling copy_from_user. Makes the race much easier to hit. This is useful for demonstration and testing purposes, but is removed in a subsequent patch. Cc: Linux Memory Management Cc: Linux Filesystems 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 @@ -1952,6 +1952,7 @@ generic_file_buffered_write(struct kiocb if (maxlen > bytes) maxlen = bytes; +#ifndef CONFIG_DEBUG_VM /* * Bring in the user page that we will copy from _first_. * Otherwise there's a nasty deadlock on copying from the @@ -1959,6 +1960,7 @@ generic_file_buffered_write(struct kiocb * up-to-date. */ fault_in_pages_readable(buf, maxlen); +#endif page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec); if (!page) { -- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <20070524053153.983797000@linux.local0.net> References: <20070524052844.860329000@suse.de> Date: Fri, 25 May 2007 22:21:49 +1000 From: npiggin@suse.de Subject: [patch 05/41] mm: debug write deadlocks Content-Disposition: inline; filename=mm-debug-write-deadlocks.patch Sender: owner-linux-mm@kvack.org Return-Path: To: Andrew Morton Cc: linux-fsdevel@vger.kernel.org, Mark Fasheh , Linux Memory Management List-ID: Allow CONFIG_DEBUG_VM to switch off the prefaulting logic, to simulate the difficult race where the page may be unmapped before calling copy_from_user. Makes the race much easier to hit. This is useful for demonstration and testing purposes, but is removed in a subsequent patch. Cc: Linux Memory Management Cc: Linux Filesystems 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 @@ -1952,6 +1952,7 @@ generic_file_buffered_write(struct kiocb if (maxlen > bytes) maxlen = bytes; +#ifndef CONFIG_DEBUG_VM /* * Bring in the user page that we will copy from _first_. * Otherwise there's a nasty deadlock on copying from the @@ -1959,6 +1960,7 @@ generic_file_buffered_write(struct kiocb * up-to-date. */ fault_in_pages_readable(buf, maxlen); +#endif page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec); if (!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