Commit 96bdc7dc61fb1b1e8e858dafb13abee8482ba064

Authored by Chris Mason
1 parent f248679e86

Btrfs: use larger system chunks

system chunks by default are very small.  This makes them slightly
larger and also fixes the conditional checks to make sure we don't
allocate a billion of them at once.

Signed-off-by: Chris Mason <chris.mason@oracle.com>

Showing 2 changed files with 4 additions and 1 deletions Side-by-side Diff

fs/btrfs/extent-tree.c
... ... @@ -3384,6 +3384,9 @@
3384 3384  
3385 3385 /* 256MB or 2% of the FS */
3386 3386 thresh = max_t(u64, 256 * 1024 * 1024, div_factor_fine(thresh, 2));
  3387 + /* system chunks need a much small threshold */
  3388 + if (sinfo->flags & BTRFS_BLOCK_GROUP_SYSTEM)
  3389 + thresh = 32 * 1024 * 1024;
3387 3390  
3388 3391 if (num_bytes > thresh && sinfo->bytes_used < div_factor(num_bytes, 8))
3389 3392 return 0;
... ... @@ -3166,7 +3166,7 @@
3166 3166 max_stripe_size = 256 * 1024 * 1024;
3167 3167 max_chunk_size = max_stripe_size;
3168 3168 } else if (type & BTRFS_BLOCK_GROUP_SYSTEM) {
3169   - max_stripe_size = 8 * 1024 * 1024;
  3169 + max_stripe_size = 32 * 1024 * 1024;
3170 3170 max_chunk_size = 2 * max_stripe_size;
3171 3171 } else {
3172 3172 printk(KERN_ERR "btrfs: invalid chunk type 0x%llx requested\n",