linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: linux-btrfs@vger.kernel.org, Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: Re: [PATCH 02/16] btrfs: qgroup flush responsibility of the caller
Date: Tue, 13 Dec 2022 11:30:50 -0500	[thread overview]
Message-ID: <Y5iouuUBYRXN5Zu4@localhost.localdomain> (raw)
In-Reply-To: <b5ea2b71e950e0452053cc7ceaade4b96ead6103.1668530684.git.rgoldwyn@suse.com>

On Tue, Nov 15, 2022 at 12:00:20PM -0600, Goldwyn Rodrigues wrote:
> Qgroup reservation will be performed under extent locks. If qgroup runs
> low, btrfs starts a flush to squeeze out the last available space from
> over-reserved uncommitted extents. Move the flush outside of the
> reserve function so it can be called by the callee of the
> reserving function.
> 
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
> ---
>  fs/btrfs/block-group.c    |  2 +-
>  fs/btrfs/delalloc-space.c | 17 +++++++----------
>  fs/btrfs/delalloc-space.h |  5 ++---
>  fs/btrfs/file.c           | 19 ++++++++++++++++---
>  fs/btrfs/inode.c          | 23 +++++++++++++----------
>  fs/btrfs/qgroup.c         | 27 +--------------------------
>  fs/btrfs/qgroup.h         | 16 ++++++----------
>  fs/btrfs/relocation.c     |  3 +--
>  fs/btrfs/root-tree.c      |  3 +--
>  9 files changed, 48 insertions(+), 67 deletions(-)
> 
> diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
> index 708d843daa72..578c6cbdef3b 100644
> --- a/fs/btrfs/block-group.c
> +++ b/fs/btrfs/block-group.c
> @@ -2945,7 +2945,7 @@ static int cache_save_setup(struct btrfs_block_group *block_group,
>  	cache_size *= fs_info->sectorsize;
>  
>  	ret = btrfs_check_data_free_space(BTRFS_I(inode), &data_reserved, 0,
> -					  cache_size, false);
> +					  cache_size);
>  	if (ret)
>  		goto out_put;
>  
> diff --git a/fs/btrfs/delalloc-space.c b/fs/btrfs/delalloc-space.c
> index 7ddb1d104e8e..b46614bec817 100644
> --- a/fs/btrfs/delalloc-space.c
> +++ b/fs/btrfs/delalloc-space.c
> @@ -130,7 +130,7 @@ int btrfs_alloc_data_chunk_ondemand(struct btrfs_inode *inode, u64 bytes)
>  
>  int btrfs_check_data_free_space(struct btrfs_inode *inode,
>  				struct extent_changeset **reserved, u64 start,
> -				u64 len, bool noflush)
> +				u64 len)
>  {
>  	struct btrfs_fs_info *fs_info = inode->root->fs_info;
>  	enum btrfs_reserve_flush_enum flush = BTRFS_RESERVE_FLUSH_DATA;
> @@ -141,9 +141,7 @@ int btrfs_check_data_free_space(struct btrfs_inode *inode,
>  	      round_down(start, fs_info->sectorsize);
>  	start = round_down(start, fs_info->sectorsize);
>  
> -	if (noflush)
> -		flush = BTRFS_RESERVE_NO_FLUSH;
> -	else if (btrfs_is_free_space_inode(inode))
> +	if (btrfs_is_free_space_inode(inode))
>  		flush = BTRFS_RESERVE_FLUSH_FREE_SPACE_INODE;
> 

You can't do this, because we also use this path for the nowait stuff, so we
need to be able to do this noflush thing.  Additionally this patch changes a
bunch of different things at once, tho tbf it's changing this and that has
cascading effects.  Take this particular change out and see what the patch looks
like and then you can decide if it needs to be split more.  Thanks,

Josef 

  reply	other threads:[~2022-12-13 16:30 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1668530684.git.rgoldwyn@suse.com>
2022-11-15 18:00 ` [PATCH 01/16] btrfs: check for range correctness while locking or setting extent bits Goldwyn Rodrigues
2022-11-17 11:09   ` Johannes Thumshirn
2022-11-22 17:17     ` Goldwyn Rodrigues
2022-11-23  8:48       ` Johannes Thumshirn
2022-11-23 13:12   ` Filipe Manana
2022-11-23 14:35     ` Goldwyn Rodrigues
2022-12-13 16:25   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 02/16] btrfs: qgroup flush responsibility of the caller Goldwyn Rodrigues
2022-12-13 16:30   ` Josef Bacik [this message]
2022-11-15 18:00 ` [PATCH 03/16] btrfs: wait ordered range before locking during truncate Goldwyn Rodrigues
2022-11-17 11:22   ` Johannes Thumshirn
2022-12-13 18:14   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 04/16] btrfs: lock extents while truncating Goldwyn Rodrigues
2022-12-13 18:29   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 05/16] btrfs: No need to lock extent while performing invalidate_folio() Goldwyn Rodrigues
2022-12-13 18:30   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 06/16] btrfs: Lock extents before pages in writepages Goldwyn Rodrigues
2022-12-13 18:39   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 07/16] btrfs: Lock extents before folio for read()s Goldwyn Rodrigues
2022-11-21 13:31   ` kernel test robot
2022-11-22 17:11     ` Goldwyn Rodrigues
2022-11-27  8:48   ` kernel test robot
2022-12-13 18:57   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 08/16] btrfs: Lock extents before pages for buffered write() Goldwyn Rodrigues
2022-12-13 19:01   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 09/16] btrfs: lock/unlock extents while creation/end of async_chunk Goldwyn Rodrigues
2022-12-13 19:05   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 10/16] btrfs: decide early if range should be async Goldwyn Rodrigues
2022-12-13 19:07   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 11/16] btrfs: lock extents before pages - defrag Goldwyn Rodrigues
2022-12-13 19:08   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 12/16] btrfs: Perform memory faults under locked extent Goldwyn Rodrigues
2022-12-13 19:12   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 13/16] btrfs: writepage fixup lock rearrangement Goldwyn Rodrigues
2022-12-13 19:13   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 14/16] btrfs: lock extent before pages for encoded read ioctls Goldwyn Rodrigues
2022-12-13 19:14   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 15/16] btrfs: lock extent before pages in encoded write Goldwyn Rodrigues
2022-12-13 19:19   ` Josef Bacik
2022-11-15 18:00 ` [PATCH 16/16] btrfs: btree_writepages lock extents before pages Goldwyn Rodrigues
2022-12-13 19:20   ` Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5iouuUBYRXN5Zu4@localhost.localdomain \
    --to=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rgoldwyn@suse.com \
    --cc=rgoldwyn@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).