All of lore.kernel.org
 help / color / mirror / Atom feed
From: Filipe Manana <fdmanana@kernel.org>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 3/4] btrfs: remove unnecessary list head initialization when syncing log
Date: Fri, 23 Jul 2021 09:11:38 +0100	[thread overview]
Message-ID: <CAL3q7H5X8=V9p_J8Ek46dxs3+_gdTgGjL42ukBpQ8+sYqeEB_w@mail.gmail.com> (raw)
In-Reply-To: <a3595186-bab3-73d9-003e-cc1d58ce38d5@suse.com>

On Fri, Jul 23, 2021 at 7:20 AM Nikolay Borisov <nborisov@suse.com> wrote:
>
>
>
> On 20.07.21 г. 18:03, fdmanana@kernel.org wrote:
> > From: Filipe Manana <fdmanana@suse.com>
> >
> > One of the last steps of syncing the log is to remove all log contextes
> > from the root's list of contextes, done at btrfs_remove_all_log_ctxs().
> > There we iterate over all the contextes in the list and delete each one
> > from the list, and after that we call INIT_LIST_HEAD() on the list. That
> > is unnecessary since at that point the list is empty.
> >
> > So just remove the INIT_LIST_HEAD() call. It's not needed, increases code
> nit: I assume you mean decreases code size
> > size (bloat-o-meter reported a delta of -122 for btrfs_sync_log() after
> > this change) and increases two critical sections delimited by log mutexes.
>
> nit: Here you also mean decreases two critsecs

No, in both cases I meant "increases".
The goal of the sentence is to list the negative consequences of
having the call, that's why the sentence starts with "It's not needed,
".

Thanks.

>
> >
> > Signed-off-by: Filipe Manana <fdmanana@suse.com>
> > ---
> >  fs/btrfs/tree-log.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> > index 90fb5a2fc60b..63f48715135c 100644
> > --- a/fs/btrfs/tree-log.c
> > +++ b/fs/btrfs/tree-log.c
> > @@ -3039,8 +3039,6 @@ static inline void btrfs_remove_all_log_ctxs(struct btrfs_root *root,
> >               list_del_init(&ctx->list);
> >               ctx->log_ret = error;
> >       }
> > -
> > -     INIT_LIST_HEAD(&root->log_ctxs[index]);
> >  }
> >
> >  /*
> >

  reply	other threads:[~2021-07-23  8:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 15:03 [PATCH 0/4] btrfs: a few fsync related minor improvements and a cleanup fdmanana
2021-07-20 15:03 ` [PATCH 1/4] btrfs: remove racy and unnecessary inode transaction update when using no-holes fdmanana
2021-07-20 15:03 ` [PATCH 2/4] btrfs: avoid unnecessary log mutex contention when syncing log fdmanana
2021-07-20 15:03 ` [PATCH 3/4] btrfs: remove unnecessary list head initialization " fdmanana
2021-07-23  6:20   ` Nikolay Borisov
2021-07-23  8:11     ` Filipe Manana [this message]
2021-07-20 15:03 ` [PATCH 4/4] btrfs: avoid unnecessary lock and leaf splits when updating inode in the log fdmanana
2021-07-21 19:50 ` [PATCH 0/4] btrfs: a few fsync related minor improvements and a cleanup Josef Bacik
2021-07-22 13:55 ` 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='CAL3q7H5X8=V9p_J8Ek46dxs3+_gdTgGjL42ukBpQ8+sYqeEB_w@mail.gmail.com' \
    --to=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.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.