Commit f9bb615a authored by Dennis Zhou's avatar Dennis Zhou Committed by David Sterba
Browse files

btrfs: make smaller extents more likely to go into bitmaps



It's less than ideal for small extents to eat into our extent budget, so
force extents <= 32KB into the bitmaps save for the first handful.

Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarDennis Zhou <dennis@kernel.org>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 5d90c5c7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2107,8 +2107,8 @@ static bool use_bitmap(struct btrfs_free_space_ctl *ctl,
		 * of cache left then go ahead an dadd them, no sense in adding
		 * the overhead of a bitmap if we don't have to.
		 */
		if (info->bytes <= fs_info->sectorsize * 4) {
			if (ctl->free_extents * 2 <= ctl->extents_thresh)
		if (info->bytes <= fs_info->sectorsize * 8) {
			if (ctl->free_extents * 3 <= ctl->extents_thresh)
				return false;
		} else {
			return false;