Skip to content

Commit

Permalink
Btrfs: reduce mount -o ssd CPU usage
Browse files Browse the repository at this point in the history
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 <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Jun 10, 2009
1 parent cfbb930 commit 2c943de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2c943de

Please sign in to comment.