Thread (4 messages) 4 messages, 2 authors, 2012-09-25

Re: [PATCH] Btrfs: limit thread pool size when remounting

From: David Sterba <hidden>
Date: 2012-09-25 12:51:10

On Tue, Sep 25, 2012 at 08:07:00PM +0800, Liu Bo wrote:
On 09/25/2012 07:39 PM, David Sterba wrote:
quoted
On Tue, Sep 25, 2012 at 02:48:33PM +0800, Liu Bo wrote:
quoted
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1158,17 +1158,20 @@ static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info,
 	printk(KERN_INFO "btrfs: resize thread pool %d -> %d\n",
 	       old_pool_size, new_pool_size);
 
-	btrfs_set_max_workers(&fs_info->generic_worker, new_pool_size);
+	btrfs_set_max_workers(&fs_info->generic_worker, min(1, new_pool_size));
How could new_pool_size be < 1 ?

There's a check in super.c to pick only values > 0
I think we just need only 1 generic_worker
I got it reversed, sorry for the noise.
quoted
quoted
 	btrfs_set_max_workers(&fs_info->workers, new_pool_size);
 	btrfs_set_max_workers(&fs_info->delalloc_workers, new_pool_size);
-	btrfs_set_max_workers(&fs_info->submit_workers, new_pool_size);
-	btrfs_set_max_workers(&fs_info->caching_workers, new_pool_size);
-	btrfs_set_max_workers(&fs_info->fixup_workers, new_pool_size);
+	btrfs_set_max_workers(&fs_info->submit_workers,
+			      min_t(u64, fs_info->fs_devices->num_devices,
+			      new_pool_size));
This ask for update also when a new device is added/removed.
Oh, yes, but we should do it in another new patch instead.
Yes, this was just a hint to pair the remount/thread_pool capabilities.

david
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help