diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-06-11 21:47:56 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:03 -0400 |
commit | 4543df7ecc8ae4928c1e51d6e7dc188d650abee4 (patch) | |
tree | c0e32d2bdaaf26f6819f5f034ed8f1679d23109f /fs/btrfs/super.c | |
parent | 35d8ba66294ff2a53c17337a1aa1ff6739492f41 (diff) |
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.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index f3274befd46a..196d0e280b19 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -67,7 +67,7 @@ static void btrfs_put_super (struct super_block * sb) | |||
67 | enum { | 67 | enum { |
68 | Opt_degraded, Opt_subvol, Opt_device, Opt_nodatasum, Opt_nodatacow, | 68 | Opt_degraded, Opt_subvol, Opt_device, Opt_nodatasum, Opt_nodatacow, |
69 | Opt_max_extent, Opt_max_inline, Opt_alloc_start, Opt_nobarrier, | 69 | Opt_max_extent, Opt_max_inline, Opt_alloc_start, Opt_nobarrier, |
70 | Opt_ssd, Opt_err, | 70 | Opt_ssd, Opt_thread_pool, Opt_err, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static match_table_t tokens = { | 73 | static match_table_t tokens = { |
@@ -80,6 +80,7 @@ static match_table_t tokens = { | |||
80 | {Opt_max_extent, "max_extent=%s"}, | 80 | {Opt_max_extent, "max_extent=%s"}, |
81 | {Opt_max_inline, "max_inline=%s"}, | 81 | {Opt_max_inline, "max_inline=%s"}, |
82 | {Opt_alloc_start, "alloc_start=%s"}, | 82 | {Opt_alloc_start, "alloc_start=%s"}, |
83 | {Opt_thread_pool, "thread_pool=%d"}, | ||
83 | {Opt_ssd, "ssd"}, | 84 | {Opt_ssd, "ssd"}, |
84 | {Opt_err, NULL} | 85 | {Opt_err, NULL} |
85 | }; | 86 | }; |
@@ -118,6 +119,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) | |||
118 | struct btrfs_fs_info *info = root->fs_info; | 119 | struct btrfs_fs_info *info = root->fs_info; |
119 | substring_t args[MAX_OPT_ARGS]; | 120 | substring_t args[MAX_OPT_ARGS]; |
120 | char *p, *num; | 121 | char *p, *num; |
122 | int intarg; | ||
121 | 123 | ||
122 | if (!options) | 124 | if (!options) |
123 | return 0; | 125 | return 0; |
@@ -166,6 +168,15 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) | |||
166 | printk(KERN_INFO "btrfs: turning off barriers\n"); | 168 | printk(KERN_INFO "btrfs: turning off barriers\n"); |
167 | btrfs_set_opt(info->mount_opt, NOBARRIER); | 169 | btrfs_set_opt(info->mount_opt, NOBARRIER); |
168 | break; | 170 | break; |
171 | case Opt_thread_pool: | ||
172 | intarg = 0; | ||
173 | match_int(&args[0], &intarg); | ||
174 | if (intarg) { | ||
175 | info->thread_pool_size = intarg; | ||
176 | printk(KERN_INFO "btrfs: thread pool %d\n", | ||
177 | info->thread_pool_size); | ||
178 | } | ||
179 | break; | ||
169 | case Opt_max_extent: | 180 | case Opt_max_extent: |
170 | num = match_strdup(&args[0]); | 181 | num = match_strdup(&args[0]); |
171 | if (num) { | 182 | if (num) { |