]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
repair: limit auto-striding concurrency apprpriately
authorDave Chinner <dchinner@redhat.com>
Mon, 3 Mar 2014 01:17:27 +0000 (12:17 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 3 Mar 2014 01:17:27 +0000 (12:17 +1100)
commit12b55baf2a4de9bef3f08593db9dbb738d1d11ce
treeb0427cf2b06aae4decbd50856cb8e3c414125d3e
parent602dcc0ec34436f2a7d30d5d58530e245c488225
repair: limit auto-striding concurrency apprpriately

It's possible to have filesystems with hundreds of AGs on systems
with little concurrency and resources. In this case, we can easily
exhaust memory and fail to create threads and have all sorts of
interesting problems.

xfs/250 can cause this to occur, with failures like:

        - agno = 707
        - agno = 692
fatal error -- cannot create worker threads, error = [11] Resource temporarily unavailable

And this:

        - agno = 484
        - agno = 782
failed to create prefetch thread: Resource temporarily unavailable

Because it's trying to create more threads than a poor little 512MB
single CPU ia32 box can handle.

So, limit concurrency to a maximum of numcpus * 8 to prevent this.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/libxfs.h
libxfs/init.h
repair/xfs_repair.c