diff options
author | Josef Bacik <josef@redhat.com> | 2009-10-07 20:44:34 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-10-08 15:21:23 -0400 |
commit | e3ccfa989752c083ceb23c823a84f7ce3a081e61 (patch) | |
tree | 197558cbee7b773b8270cd861f882a37beacd2ed /fs/btrfs/ctree.h | |
parent | 32c00aff718bb54a214b39146bdd9ac01511cd25 (diff) |
Btrfs: async delalloc flushing under space pressure
This patch moves the delalloc flushing that occurs when we are under space
pressure off to a async thread pool. This helps since we only free up
metadata space when we actually insert the extent item, which means it takes
quite a while for space to be free'ed up if we wait on all ordered extents.
However, if space is freed up due to inline extents being inserted, we can
wake people who are waiting up early, and they can finish their work.
Signed-off-by: Josef Bacik <jbacik@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index dbdada569507..a362dd617e97 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -691,17 +691,17 @@ struct btrfs_space_info { | |||
691 | 691 | ||
692 | struct list_head list; | 692 | struct list_head list; |
693 | 693 | ||
694 | /* for controlling how we free up space for allocations */ | ||
695 | wait_queue_head_t allocate_wait; | ||
696 | wait_queue_head_t flush_wait; | ||
697 | int allocating_chunk; | ||
698 | int flushing; | ||
699 | |||
694 | /* for block groups in our same type */ | 700 | /* for block groups in our same type */ |
695 | struct list_head block_groups; | 701 | struct list_head block_groups; |
696 | spinlock_t lock; | 702 | spinlock_t lock; |
697 | struct rw_semaphore groups_sem; | 703 | struct rw_semaphore groups_sem; |
698 | atomic_t caching_threads; | 704 | atomic_t caching_threads; |
699 | |||
700 | int allocating_chunk; | ||
701 | wait_queue_head_t wait; | ||
702 | |||
703 | int flushing; | ||
704 | wait_queue_head_t flush_wait; | ||
705 | }; | 705 | }; |
706 | 706 | ||
707 | /* | 707 | /* |
@@ -918,6 +918,7 @@ struct btrfs_fs_info { | |||
918 | struct btrfs_workers endio_meta_write_workers; | 918 | struct btrfs_workers endio_meta_write_workers; |
919 | struct btrfs_workers endio_write_workers; | 919 | struct btrfs_workers endio_write_workers; |
920 | struct btrfs_workers submit_workers; | 920 | struct btrfs_workers submit_workers; |
921 | struct btrfs_workers enospc_workers; | ||
921 | /* | 922 | /* |
922 | * fixup workers take dirty pages that didn't properly go through | 923 | * fixup workers take dirty pages that didn't properly go through |
923 | * the cow mechanism and make them safe to write. It happens | 924 | * the cow mechanism and make them safe to write. It happens |