diff mbox series

[RFC,4/9] ext4: Do not call FC trace event if FS does not support FC

Message ID a62c8d1c0d8a01e2b1e3afc9c2b012c04c54b137.1645558375.git.riteshh@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series ext4: Improve FC trace events and discuss one FC failure | expand

Commit Message

Ritesh Harjani Feb. 22, 2022, 8:34 p.m. UTC
This just puts trace_ext4_fc_commit_start(sb) & ktime_get()
for measuring FC commit time, after the check of whether sb
supports JOURNAL_FAST_COMMIT or not.

Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
---
 fs/ext4/fast_commit.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jan Kara Feb. 23, 2022, 9:41 a.m. UTC | #1
On Wed 23-02-22 02:04:12, Ritesh Harjani wrote:
> This just puts trace_ext4_fc_commit_start(sb) & ktime_get()
> for measuring FC commit time, after the check of whether sb
> supports JOURNAL_FAST_COMMIT or not.
> 
> Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/fast_commit.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
> index bf70879bb4fe..7fb1eceef30c 100644
> --- a/fs/ext4/fast_commit.c
> +++ b/fs/ext4/fast_commit.c
> @@ -1167,13 +1167,13 @@ int ext4_fc_commit(journal_t *journal, tid_t commit_tid)
>  	int status = EXT4_FC_STATUS_OK, fc_bufs_before = 0;
>  	ktime_t start_time, commit_time;
>  
> +	if (!test_opt2(sb, JOURNAL_FAST_COMMIT))
> +		return jbd2_complete_transaction(journal, commit_tid);
> +
>  	trace_ext4_fc_commit_start(sb);
>  
>  	start_time = ktime_get();
>  
> -	if (!test_opt2(sb, JOURNAL_FAST_COMMIT))
> -		return jbd2_complete_transaction(journal, commit_tid);
> -
>  restart_fc:
>  	ret = jbd2_fc_begin_commit(journal, commit_tid);
>  	if (ret == -EALREADY) {
> -- 
> 2.31.1
>
harshad shirwadkar Feb. 27, 2022, 6:30 p.m. UTC | #2
Looks good.

Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>

- Harshad

On Wed, 23 Feb 2022 at 01:41, Jan Kara <jack@suse.cz> wrote:
>
> On Wed 23-02-22 02:04:12, Ritesh Harjani wrote:
> > This just puts trace_ext4_fc_commit_start(sb) & ktime_get()
> > for measuring FC commit time, after the check of whether sb
> > supports JOURNAL_FAST_COMMIT or not.
> >
> > Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
>
> Looks good. Feel free to add:
>
> Reviewed-by: Jan Kara <jack@suse.cz>
>
>                                                                 Honza
>
> > ---
> >  fs/ext4/fast_commit.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
> > index bf70879bb4fe..7fb1eceef30c 100644
> > --- a/fs/ext4/fast_commit.c
> > +++ b/fs/ext4/fast_commit.c
> > @@ -1167,13 +1167,13 @@ int ext4_fc_commit(journal_t *journal, tid_t commit_tid)
> >       int status = EXT4_FC_STATUS_OK, fc_bufs_before = 0;
> >       ktime_t start_time, commit_time;
> >
> > +     if (!test_opt2(sb, JOURNAL_FAST_COMMIT))
> > +             return jbd2_complete_transaction(journal, commit_tid);
> > +
> >       trace_ext4_fc_commit_start(sb);
> >
> >       start_time = ktime_get();
> >
> > -     if (!test_opt2(sb, JOURNAL_FAST_COMMIT))
> > -             return jbd2_complete_transaction(journal, commit_tid);
> > -
> >  restart_fc:
> >       ret = jbd2_fc_begin_commit(journal, commit_tid);
> >       if (ret == -EALREADY) {
> > --
> > 2.31.1
> >
> --
> Jan Kara <jack@suse.com>
> SUSE Labs, CR
diff mbox series

Patch

diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index bf70879bb4fe..7fb1eceef30c 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -1167,13 +1167,13 @@  int ext4_fc_commit(journal_t *journal, tid_t commit_tid)
 	int status = EXT4_FC_STATUS_OK, fc_bufs_before = 0;
 	ktime_t start_time, commit_time;
 
+	if (!test_opt2(sb, JOURNAL_FAST_COMMIT))
+		return jbd2_complete_transaction(journal, commit_tid);
+
 	trace_ext4_fc_commit_start(sb);
 
 	start_time = ktime_get();
 
-	if (!test_opt2(sb, JOURNAL_FAST_COMMIT))
-		return jbd2_complete_transaction(journal, commit_tid);
-
 restart_fc:
 	ret = jbd2_fc_begin_commit(journal, commit_tid);
 	if (ret == -EALREADY) {