Commit b2232219 authored by Dave Chinner's avatar Dave Chinner Committed by Alex Elder

xfs: ensure reclaim cursor is reset correctly at end of AG

On a 32 bit highmem PowerPC machine, the XFS inode cache was growing
without bound and exhausting low memory causing the OOM killer to be
triggered. After some effort, the problem was reproduced on a 32 bit
x86 highmem machine.

The problem is that the per-ag inode reclaim index cursor was not
getting reset to the start of the AG if the radix tree tag lookup
found no more reclaimable inodes. Hence every further reclaim
attempt started at the same index beyond where any reclaimable
inodes lay, and no further background reclaim ever occurred from the
AG.

Without background inode reclaim the VM driven cache shrinker
simply cannot keep up with cache growth, and OOM is the result.

While the change that exposed the problem was the conversion of the
inode reclaim to use work queues for background reclaim, it was not
the cause of the bug. The bug was introduced when the cursor code
was added, just waiting for some weird configuration to strike....
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Tested-By: default avatarChristian Kujau <lists@nerdbynature.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
parent 8c1fdd0b
...@@ -926,6 +926,7 @@ xfs_reclaim_inodes_ag( ...@@ -926,6 +926,7 @@ xfs_reclaim_inodes_ag(
XFS_LOOKUP_BATCH, XFS_LOOKUP_BATCH,
XFS_ICI_RECLAIM_TAG); XFS_ICI_RECLAIM_TAG);
if (!nr_found) { if (!nr_found) {
done = 1;
rcu_read_unlock(); rcu_read_unlock();
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment