]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: try cluster but don't advance in search list
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Thu, 8 Dec 2011 01:08:40 +0000 (20:08 -0500)
committerChris Mason <chris.mason@oracle.com>
Fri, 16 Dec 2011 19:43:01 +0000 (14:43 -0500)
commit769a4aa683463902b1067a21f4dffbecd7f889f5
tree90c6d9a7968c186d31877749df4c0146fd119ebc
parent74d2ba270e874ec5b05d2e6f940c1741fe0cea50
Btrfs: try cluster but don't advance in search list

When we find an existing cluster, we switch to its block group as the
current block group, possibly skipping multiple blocks in the process.
Furthermore, under heavy contention, multiple threads may fail to
allocate from a cluster and then release just-created clusters just to
proceed to create new ones in a different block group.

This patch tries to allocate from an existing cluster regardless of its
block group, and doesn't switch to that group, instead proceeding to
try to allocate a cluster from the group it was iterating before the
attempt.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 274bd4fb3ed6b72c1d77ef8850511f09fc6b8e4d)
fs/btrfs/extent-tree.c