Commit 966dbde2c208e07bab7a45a7855e1e693eabe661
Committed by
Linus Torvalds
1 parent
94054fa3fc
ext4: warn if direct reclaim tries to writeback pages
Direct reclaim should never writeback pages. Warn if an attempt is made. Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Dave Chinner <david@fromorbit.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Johannes Weiner <jweiner@redhat.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Jan Kara <jack@suse.cz> Cc: Minchan Kim <minchan.kim@gmail.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Alex Elder <aelder@sgi.com> Cc: Theodore Ts'o <tytso@mit.edu> Cc: Chris Mason <chris.mason@oracle.com> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
fs/ext4/inode.c
... | ... | @@ -1811,8 +1811,12 @@ |
1811 | 1811 | * We don't want to do block allocation, so redirty |
1812 | 1812 | * the page and return. We may reach here when we do |
1813 | 1813 | * a journal commit via journal_submit_inode_data_buffers. |
1814 | - * We can also reach here via shrink_page_list | |
1814 | + * We can also reach here via shrink_page_list but it | |
1815 | + * should never be for direct reclaim so warn if that | |
1816 | + * happens | |
1815 | 1817 | */ |
1818 | + WARN_ON_ONCE((current->flags & (PF_MEMALLOC|PF_KSWAPD)) == | |
1819 | + PF_MEMALLOC); | |
1816 | 1820 | goto redirty_page; |
1817 | 1821 | } |
1818 | 1822 | if (commit_write) |