Skip to content

Commit 94054fa

Browse files
Mel Gormantorvalds
authored andcommitted
xfs: warn if direct reclaim tries to writeback pages
Direct reclaim should never writeback pages. For now, handle the situation and warn about it. Ultimately, this will be a BUG_ON. 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>
1 parent a18bba0 commit 94054fa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎fs/xfs/xfs_aops.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,11 +902,11 @@ xfs_vm_writepage(
902902
* random callers for direct reclaim or memcg reclaim. We explicitly
903903
* allow reclaim from kswapd as the stack usage there is relatively low.
904904
*
905-
* This should really be done by the core VM, but until that happens
906-
* filesystems like XFS, btrfs and ext4 have to take care of this
907-
* by themselves.
905+
* This should never happen except in the case of a VM regression so
906+
* warn about it.
908907
*/
909-
if ((current->flags & (PF_MEMALLOC|PF_KSWAPD)) == PF_MEMALLOC)
908+
if (WARN_ON_ONCE((current->flags & (PF_MEMALLOC|PF_KSWAPD)) ==
909+
PF_MEMALLOC))
910910
goto redirty;
911911

912912
/*

0 commit comments

Comments
 (0)