summaryrefslogtreecommitdiff
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-06-12 01:47:56 (GMT)
committerChris Mason <chris.mason@oracle.com>2008-09-25 15:04:03 (GMT)
commit4543df7ecc8ae4928c1e51d6e7dc188d650abee4 (patch)
treec0e32d2bdaaf26f6819f5f034ed8f1679d23109f /fs/btrfs/super.c
parent35d8ba66294ff2a53c17337a1aa1ff6739492f41 (diff)
downloadlinux-fsl-qoriq-4543df7ecc8ae4928c1e51d6e7dc188d650abee4.tar.xz
Btrfs: Add a mount option to control worker thread pool size
mount -o thread_pool_size changes the default, which is min(num_cpus + 2, 8). Larger thread pools would make more sense on very large disk arrays. This mount option controls the max size of each thread pool. There are multiple thread pools, so the total worker count will be larger than the mount option. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index f3274be..196d0e2 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -67,7 +67,7 @@ static void btrfs_put_super (struct super_block * sb)
enum {
Opt_degraded, Opt_subvol, Opt_device, Opt_nodatasum, Opt_nodatacow,
Opt_max_extent, Opt_max_inline, Opt_alloc_start, Opt_nobarrier,
- Opt_ssd, Opt_err,
+ Opt_ssd, Opt_thread_pool, Opt_err,
};
static match_table_t tokens = {
@@ -80,6 +80,7 @@ static match_table_t tokens = {
{Opt_max_extent, "max_extent=%s"},
{Opt_max_inline, "max_inline=%s"},
{Opt_alloc_start, "alloc_start=%s"},
+ {Opt_thread_pool, "thread_pool=%d"},
{Opt_ssd, "ssd"},
{Opt_err, NULL}
};
@@ -118,6 +119,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
struct btrfs_fs_info *info = root->fs_info;
substring_t args[MAX_OPT_ARGS];
char *p, *num;
+ int intarg;
if (!options)
return 0;
@@ -166,6 +168,15 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
printk(KERN_INFO "btrfs: turning off barriers\n");
btrfs_set_opt(info->mount_opt, NOBARRIER);
break;
+ case Opt_thread_pool:
+ intarg = 0;
+ match_int(&args[0], &intarg);
+ if (intarg) {
+ info->thread_pool_size = intarg;
+ printk(KERN_INFO "btrfs: thread pool %d\n",
+ info->thread_pool_size);
+ }
+ break;
case Opt_max_extent:
num = match_strdup(&args[0]);
if (num) {