From: Nick Piggin 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 Signed-off-by: Andrew Morton --- mm/filemap.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN mm/filemap.c~mm-debug-write-deadlocks mm/filemap.c --- a/mm/filemap.c~mm-debug-write-deadlocks +++ a/mm/filemap.c @@ -1898,6 +1898,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 @@ -1905,6 +1906,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) { _