Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128803
b: refs/heads/master
c: 1cc127b
h: refs/heads/master
i:
  128801: 30bd049
  128799: dc10fcb
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 46c5b0e commit e2d7165
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df5b5520b21d8a2554ede65c09b288833c77144d
refs/heads/master: 1cc127b5d1b71453091859301de4a7dd6ee96fa8
4 changes: 4 additions & 0 deletions trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,13 @@ struct btrfs_fs_info {
* can run with FS locks held, and the writers may be waiting for
* those locks. We don't want ordering in the pending list to cause
* deadlocks, and so the two are serviced separately.
*
* A third pool does submit_bio to avoid deadlocking with the other
* two
*/
struct btrfs_workers workers;
struct btrfs_workers endio_workers;
struct btrfs_workers submit_workers;
int thread_pool_size;

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
Expand Down
4 changes: 4 additions & 0 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,8 +1233,10 @@ struct btrfs_root *open_ctree(struct super_block *sb,
* cannot dynamically grow.
*/
btrfs_init_workers(&fs_info->workers, fs_info->thread_pool_size);
btrfs_init_workers(&fs_info->submit_workers, fs_info->thread_pool_size);
btrfs_init_workers(&fs_info->endio_workers, fs_info->thread_pool_size);
btrfs_start_workers(&fs_info->workers, 1);
btrfs_start_workers(&fs_info->submit_workers, 1);
btrfs_start_workers(&fs_info->endio_workers, fs_info->thread_pool_size);


Expand Down Expand Up @@ -1343,6 +1345,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
extent_io_tree_empty_lru(&BTRFS_I(fs_info->btree_inode)->io_tree);
btrfs_stop_workers(&fs_info->workers);
btrfs_stop_workers(&fs_info->endio_workers);
btrfs_stop_workers(&fs_info->submit_workers);
fail_iput:
iput(fs_info->btree_inode);
fail:
Expand Down Expand Up @@ -1597,6 +1600,7 @@ int close_ctree(struct btrfs_root *root)

btrfs_stop_workers(&fs_info->workers);
btrfs_stop_workers(&fs_info->endio_workers);
btrfs_stop_workers(&fs_info->submit_workers);

iput(fs_info->btree_inode);
#if 0
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2112,7 +2112,8 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,
spin_unlock(&device->io_lock);

if (should_queue)
btrfs_queue_worker(&root->fs_info->workers, &device->work);
btrfs_queue_worker(&root->fs_info->submit_workers,
&device->work);
return 0;
}

Expand Down

0 comments on commit e2d7165

Please sign in to comment.