]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: limit extent length for allocation to AG size
authorDave Chinner <dchinner@redhat.com>
Thu, 27 Jan 2011 01:16:28 +0000 (12:16 +1100)
committerAlex Elder <aelder@sgi.com>
Fri, 28 Jan 2011 15:05:35 +0000 (09:05 -0600)
commit24057665c2d0f652757fc31e59f9d64f7cf7d725
treeacb620a958da7f3528acc04899c685591663fc24
parent5dbcf04e4ebdc77285f1381447eef22cb064dea5
xfs: limit extent length for allocation to AG size

Delayed allocation extents can be larger than AGs, so when trying to
convert a large range we may scan every AG inside
xfs_bmap_alloc_nullfb() trying to find an AG with a size larger than
an AG. We should stop when we find the first AG with a maximum
possible allocation size. This causes excessive CPU usage when there
are lots of AGs.

The same problem occurs when doing preallocation of a range larger
than an AG.

Fix the problem by limiting real allocation lengths to the maximum
that an AG can support. This means if we have empty AGs, we'll stop
the search at the first of them. If there are no empty AGs, we'll
still scan them all, but that is a different problem....

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
fs/xfs/xfs_alloc.h
fs/xfs/xfs_bmap.c