diff mbox series

[21/23] btrfs: run delayed iputs before committing the transaction for data

Message ID 20200131223613.490779-22-josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series Convert data reservations to the ticketing infrastructure | expand

Commit Message

Josef Bacik Jan. 31, 2020, 10:36 p.m. UTC
Before we were waiting on iputs after we committed the transaction, but
this doesn't really make much sense.  We want to reclaim any space we
may have in order to be more likely to commit the transaction, due to
pinned space being added by running the delayed iputs.  Fix this by
making delayed iputs run before committing the transaction.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/space-info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nikolay Borisov Feb. 3, 2020, 4:13 p.m. UTC | #1
On 1.02.20 г. 0:36 ч., Josef Bacik wrote:
> Before we were waiting on iputs after we committed the transaction, but
> this doesn't really make much sense.  We want to reclaim any space we
> may have in order to be more likely to commit the transaction, due to
> pinned space being added by running the delayed iputs.  Fix this by
> making delayed iputs run before committing the transaction.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  fs/btrfs/space-info.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
> index 0c2d8e66cf5e..c86fad4174f1 100644
> --- a/fs/btrfs/space-info.c
> +++ b/fs/btrfs/space-info.c
> @@ -804,8 +804,8 @@ static const enum btrfs_flush_state evict_flush_states[] = {
>  
>  static const enum btrfs_flush_state data_flush_states[] = {
>  	FLUSH_DELALLOC_WAIT,
> -	COMMIT_TRANS,
>  	RUN_DELAYED_IPUTS,
> +	COMMIT_TRANS,
>  };
>  
>  static void priority_reclaim_metadata_space(struct btrfs_fs_info *fs_info,
>
diff mbox series

Patch

diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index 0c2d8e66cf5e..c86fad4174f1 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -804,8 +804,8 @@  static const enum btrfs_flush_state evict_flush_states[] = {
 
 static const enum btrfs_flush_state data_flush_states[] = {
 	FLUSH_DELALLOC_WAIT,
-	COMMIT_TRANS,
 	RUN_DELAYED_IPUTS,
+	COMMIT_TRANS,
 };
 
 static void priority_reclaim_metadata_space(struct btrfs_fs_info *fs_info,