]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
btrfs: make smaller extents more likely to go into bitmaps
authorDennis Zhou <dennis@kernel.org>
Thu, 2 Jan 2020 21:26:44 +0000 (16:26 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 20 Jan 2020 15:41:00 +0000 (16:41 +0100)
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: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-cache.c

index f75eb737e713db87f473b0c8beeaab397f258a5f..30e0108520400a53eca767e05b68c221d1b3d0ef 100644 (file)
@@ -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;