Btrfs: reduce mount -o ssd CPU usage
authorChris Mason <[email protected]>
Mon, 18 May 2009 14:41:58 +0000 (10:41 -0400)
committerChris Mason <[email protected]>
Wed, 10 Jun 2009 15:29:48 +0000 (11:29 -0400)
The block allocator in SSD mode will try to find groups of free blocks
that are close together.  This commit makes it loop less on a given
group size before bumping it.

The end result is that we are less likely to fill small holes in the
available free space, but we don't waste as much CPU building the
large cluster used by ssd mode.

Signed-off-by: Chris Mason <[email protected]>
fs/btrfs/free-space-cache.c

index 0bc93657b4601e41b25790614c80573497fdc98c..280165581c57213bbf46fdf81cb2711142250060 100644 (file)
@@ -652,7 +652,7 @@ again:
                        last = entry;
                        max_extent = 0;
                        total_retries++;
-                       if (total_retries % 256 == 0) {
+                       if (total_retries % 64 == 0) {
                                if (min_bytes >= (bytes + empty_size)) {
                                        ret = -ENOSPC;
                                        goto out;