diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-07-20 03:43:39 +0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2010-07-20 03:43:39 +0400 |
commit | 16fd5367370099b59d96e30bb7d9de8d419659f2 (patch) | |
tree | a9c12adb84f363ac48a0846de7a9464b1631e464 /fs/xfs/xfs_error.c | |
parent | 70e60ce71516c3a9e882edb70a09f696a05961db (diff) | |
download | linux-16fd5367370099b59d96e30bb7d9de8d419659f2.tar.xz |
xfs: track AGs with reclaimable inodes in per-ag radix tree
https://bugzilla.kernel.org/show_bug.cgi?id=16348
When the filesystem grows to a large number of allocation groups,
the summing of recalimable inodes gets expensive. In many cases,
most AGs won't have any reclaimable inodes and so we are wasting CPU
time aggregating over these AGs. This is particularly important for
the inode shrinker that gets called frequently under memory
pressure.
To avoid the overhead, track AGs with reclaimable inodes in the
per-ag radix tree so that we can find all the AGs with reclaimable
inodes via a simple gang tag lookup. This involves setting the tag
when the first reclaimable inode is tracked in the AG, and removing
the tag when the last reclaimable inode is removed from the tree.
Then the summation process becomes a loop walking the radix tree
summing AGs with the reclaim tag set.
This significantly reduces the overhead of scanning - a 6400 AG
filesystea now only uses about 25% of a cpu in kswapd while slab
reclaim progresses instead of being permanently stuck at 100% CPU
and making little progress. Clean filesystems filesystems will see
no overhead and the overhead only increases linearly with the number
of dirty AGs.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_error.c')
0 files changed, 0 insertions, 0 deletions