From: Chris Mason Date: Mon, 18 May 2009 14:41:58 +0000 (-0400) Subject: Btrfs: reduce mount -o ssd CPU usage X-Git-Tag: v2.6.31-rc1~380^2~18 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=2c943de6ad795a174dcc424c293bb77f15ae3b8c;p=linux.git Btrfs: reduce mount -o ssd CPU usage 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 --- diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 0bc93657b460..280165581c57 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -652,7 +652,7 @@ int btrfs_find_space_cluster(struct btrfs_trans_handle *trans, 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;