Skip to content

Commit

Permalink
mm: debug write deadlocks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Oct 16, 2007
1 parent ae37461 commit 5fe1723
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1878,13 +1878,15 @@ 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
* same page as we're writing to, without it being marked
* up-to-date.
*/
fault_in_pages_readable(buf, maxlen);
#endif

page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec);
if (!page) {
Expand Down

0 comments on commit 5fe1723

Please sign in to comment.