All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>,
	linux-btrfs@vger.kernel.org, dsterba@suse.com, clm@fb.com
Subject: Re: [PATCH 2/9] btrfs: qgroup: Re-arrange tracepoint timing to co-operate with reserved space tracepoint
Date: Tue, 7 Mar 2017 14:11:09 -0500	[thread overview]
Message-ID: <15ffc421-17f7-c7b1-824c-00f23a1f51d4@suse.com> (raw)
In-Reply-To: <20170227071039.8335-3-quwenruo@cn.fujitsu.com>


[-- Attachment #1.1: Type: text/plain, Size: 2509 bytes --]

On 2/27/17 2:10 AM, Qu Wenruo wrote:
> Newly introduced qgroup reserved space trace points are normally nested
> into several common qgroup operations.
> 
> While some other trace points are not well placed to co-operate with
> them, causing confusing output.
> 
> This patch re-arrange trace_btrfs_qgroup_release_data() and
> trace_btrfs_qgroup_free_delayed_ref() trace points so they are triggered
> before reserved space ones.
> 
> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>

Reviewed-by: Jeff Mahoney <jeffm@suse.com>

> ---
>  fs/btrfs/qgroup.c | 10 +++++-----
>  fs/btrfs/qgroup.h |  6 +-----
>  2 files changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index b303d4794026..e46499cafdbf 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -2895,14 +2895,14 @@ static int __btrfs_qgroup_release_data(struct inode *inode, u64 start, u64 len,
>  	if (ret < 0)
>  		goto out;
>  
> -	if (free) {
> -		btrfs_qgroup_free_refroot(BTRFS_I(inode)->root->fs_info,
> -				BTRFS_I(inode)->root->objectid,
> -				changeset.bytes_changed);
> +	if (free)
>  		trace_op = QGROUP_FREE;
> -	}
>  	trace_btrfs_qgroup_release_data(inode, start, len,
>  					changeset.bytes_changed, trace_op);
> +	if (free)
> +		btrfs_qgroup_free_refroot(BTRFS_I(inode)->root->fs_info,
> +				BTRFS_I(inode)->root->objectid,
> +				changeset.bytes_changed);
>  out:
>  	ulist_release(&changeset.range_changed);
>  	return ret;
> diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h
> index 26932a8a1993..92608edf0e89 100644
> --- a/fs/btrfs/qgroup.h
> +++ b/fs/btrfs/qgroup.h
> @@ -186,15 +186,11 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
>  			 struct btrfs_qgroup_inherit *inherit);
>  void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info,
>  			       u64 ref_root, u64 num_bytes);
> -/*
> - * TODO: Add proper trace point for it, as btrfs_qgroup_free() is
> - * called by everywhere, can't provide good trace for delayed ref case.
> - */
>  static inline void btrfs_qgroup_free_delayed_ref(struct btrfs_fs_info *fs_info,
>  						 u64 ref_root, u64 num_bytes)
>  {
> -	btrfs_qgroup_free_refroot(fs_info, ref_root, num_bytes);
>  	trace_btrfs_qgroup_free_delayed_ref(fs_info, ref_root, num_bytes);
> +	btrfs_qgroup_free_refroot(fs_info, ref_root, num_bytes);
>  }
>  void assert_qgroups_uptodate(struct btrfs_trans_handle *trans);
>  
> 


-- 
Jeff Mahoney
SUSE Labs


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2017-03-07 19:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27  7:10 [PATCH 0/9 PULL REQUEST] Qgroup fixes for 4.11 Qu Wenruo
2017-02-27  7:10 ` [PATCH 1/9] btrfs: qgroup: Add trace point for qgroup reserved space Qu Wenruo
2017-03-07 15:19   ` David Sterba
2017-03-07 16:30   ` Jeff Mahoney
2017-03-09  6:02     ` Qu Wenruo
2017-02-27  7:10 ` [PATCH 2/9] btrfs: qgroup: Re-arrange tracepoint timing to co-operate with reserved space tracepoint Qu Wenruo
2017-03-07 19:11   ` Jeff Mahoney [this message]
2017-02-27  7:10 ` [PATCH 3/9] btrfs: qgroup: Fix qgroup corruption caused by inode_cache mount option Qu Wenruo
2017-03-07 19:21   ` Jeff Mahoney
2017-03-08  0:36     ` Qu Wenruo
2017-03-08 14:23       ` Jeff Mahoney
2017-02-27  7:10 ` [PATCH 4/9] btrfs: qgroup: Add quick exit for non-fs extents Qu Wenruo
2017-02-27  7:10 ` [PATCH 5/9] btrfs: qgroup: Cleanup btrfs_qgroup_prepare_account_extents function Qu Wenruo
2017-02-27  7:10 ` [PATCH 6/9] btrfs: qgroup: Return actually freed bytes for qgroup release or free data Qu Wenruo
2017-02-27  7:10 ` [PATCH 7/9] btrfs: qgroup: Fix qgroup reserved space underflow caused by buffered write and quota enable Qu Wenruo
2017-02-27  7:10 ` [PATCH 8/9] btrfs: qgroup: Introduce extent changeset for qgroup reserve functions Qu Wenruo
2017-02-27  7:10 ` [PATCH 9/9] btrfs: qgroup: Fix qgroup reserved space underflow by only freeing reserved ranges Qu Wenruo
2017-03-06  8:08 ` [PATCH 0/9 PULL REQUEST] Qgroup fixes for 4.11 Qu Wenruo
2017-03-06 16:44   ` David Sterba
2017-03-06 17:56     ` Chris Mason
2017-03-08 14:24   ` Jeff Mahoney
2017-03-14 13:17     ` David Sterba
2017-03-07 15:13 ` David Sterba
2017-03-08  0:28   ` Qu Wenruo
2017-03-14 13:32     ` David Sterba

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=15ffc421-17f7-c7b1-824c-00f23a1f51d4@suse.com \
    --to=jeffm@suse.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.