diff options
author | Arne Jansen <sensille@gmx.net> | 2011-04-12 12:07:57 +0200 |
---|---|---|
committer | Arne Jansen <sensille@gmx.net> | 2011-05-13 15:36:14 +0200 |
commit | 73c5de0051533cbdf2bb656586c3eb21a475aa7d (patch) | |
tree | 296ad014c04ed44d9b89ac6b3818d5e98b34dd4f /Documentation/RCU | |
parent | a9c9bf68276c36898e23db770a65bd9b75bfac58 (diff) | |
download | kernel_samsung_aries-73c5de0051533cbdf2bb656586c3eb21a475aa7d.zip kernel_samsung_aries-73c5de0051533cbdf2bb656586c3eb21a475aa7d.tar.gz kernel_samsung_aries-73c5de0051533cbdf2bb656586c3eb21a475aa7d.tar.bz2 |
btrfs: quasi-round-robin for chunk allocation
In a multi device setup, the chunk allocator currently always allocates
chunks on the devices in the same order. This leads to a very uneven
distribution, especially with RAID1 or RAID10 and an uneven number of
devices.
This patch always sorts the devices before allocating, and allocates the
stripes on the devices with the most available space, as long as there
is enough space available. In a low space situation, it first tries to
maximize striping.
The patch also simplifies the allocator and reduces the checks for
corner cases.
The simplification is done by several means. First, it defines the
properties of each RAID type upfront. These properties are used afterwards
instead of differentiating cases in several places.
Second, the old allocator defined a minimum stripe size for each block
group type, tried to find a large enough chunk, and if this fails just
allocates a smaller one. This is now done in one step. The largest possible
chunk (up to max_chunk_size) is searched and allocated.
Because we now have only one pass, the allocation of the map (struct
map_lookup) is moved down to the point where the number of stripes is
already known. This way we avoid reallocation of the map.
We still avoid allocating stripes that are not a multiple of STRIPE_SIZE.
Diffstat (limited to 'Documentation/RCU')
0 files changed, 0 insertions, 0 deletions