Thread (9 messages) 9 messages, 4 authors, 2021-07-23

Re: [PATCH 3/4] btrfs: remove unnecessary list head initialization when syncing log

From: Filipe Manana <fdmanana@kernel.org>
Date: 2021-07-23 08:11:52

On Fri, Jul 23, 2021 at 7:20 AM Nikolay Borisov [off-list ref] wrote:


On 20.07.21 г. 18:03, fdmanana@kernel.org wrote:
quoted
From: Filipe Manana <redacted>

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
quoted
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.
quoted
Signed-off-by: Filipe Manana <redacted>
---
 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]);
 }

 /*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help