]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
mm: debug write deadlocks
authorNick Piggin <npiggin@suse.de>
Tue, 16 Oct 2007 08:24:56 +0000 (01:24 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:42:54 +0000 (09:42 -0700)
Allow CONFIG_DEBUG_VM to switch off the prefaulting logic, to simulate the
Makes the race much easier to hit.

This is useful for demonstration and testing purposes, but is removed in a
subsequent patch.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c

index f74d0520186247ab05c8c727718cf490864832f0..0c54fc9b8e3d67325d2473e78eb0aadad4e70502 100644 (file)
@@ -1878,6 +1878,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
                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
@@ -1885,6 +1886,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
                 * up-to-date.
                 */
                fault_in_pages_readable(buf, maxlen);
+#endif
 
                page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec);
                if (!page) {