Skip to contentSkip to conversation

delayed inodes implementation questions

DISCUSSION Nikolay Borisov 3 participants 4 messages Sep 29, 2017 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello,

I've been studying the implementation of the delayed inodes feature and have a couple of questions.

1. Why are there 2 lists when each and every node is on both lists at the same time? So if we happen to be running the async worker we are processing nodes based on the prepared_list, at the same time if there is a concurent transaction commit happening then the exact some nodes are going to be processed from the node_list - it's not a functional problem but the presence of 2 lists and each node being on the same list at the same time just seems a bit redundant.

2. in btrfs_next_delayed_node can this code really trigger:

 if (!test_bit(BTRFS_DELAYED_NODE_IN_LIST, &node->flags)) {
                /* not in the list */

                if (list_empty(&delayed_root->node_list))

                        goto out;

                p = delayed_root->node_list.next;

In order for !test_bit(BTRFS_DELAYED_NODE_IN_LIST, &node->flags) to be true this means this node should have been btrfs_dequeue_delayed_node underneath us? Can this really happen e.g. have multiple concurrent __btrfs_run_delayed_items executions?

#1 lore raw
Quoted 5 lines · Nikolay Borisov

Hello,

I've been studying the implementation of the delayed inodes feature and have a couple of questions.

Sorry I can't answer your question, but as you may already know by the rejection mail, Miao Xie has left Fujitsu and has been for several years.

And I'm not sure if he still checks btrfs mail list, so you may be on your own.

So to avoid such situation, it would be better to maintain a wiki page for such less maintained features, about it design principle and possible corner cases.

This will make later developers quite happy. (personally speaking, this should be done before coding)

Thanks,
Qu

Quoted 29 lines

1. Why are there 2 lists when each and every node is on both lists at the same time? So if we happen to be running the async worker we are processing nodes based on the prepared_list, at the same time if there is a concurent transaction commit happening then the exact some nodes are going to be processed from the node_list - it's not a functional problem but the presence of 2 lists and each node being on the same list at the same time just seems a bit redundant.

2. in btrfs_next_delayed_node can this code really trigger:

  if (!test_bit(BTRFS_DELAYED_NODE_IN_LIST, &node->flags)) {
                 /* not in the list */
                 if (list_empty(&delayed_root->node_list))

                         goto out;

                 p = delayed_root->node_list.next;

In order for !test_bit(BTRFS_DELAYED_NODE_IN_LIST, &node->flags) to be true this means this node should have been btrfs_dequeue_delayed_node underneath us? Can this really happen e.g. have multiple concurrent __btrfs_run_delayed_items executions?
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 15 lines · Qu Wenruo
Quoted 5 lines · Nikolay Borisov

Hello,

I've been studying the implementation of the delayed inodes feature and have a couple of questions.

Sorry I can't answer your question, but as you may already know by the rejection mail, Miao Xie has left Fujitsu and has been for several years.

And I'm not sure if he still checks btrfs mail list, so you may be on your own.

Quoted 6 lines

So to avoid such situation, it would be better to maintain a wiki page for such less maintained features, about it design principle and possible corner cases.

This will make later developers quite happy. (personally speaking, this should be done before coding)

I'm asking the question exactly because I'm in the process of creating said documentation.

Quoted 33 lines

Thanks,
Qu

Quoted 29 lines

1. Why are there 2 lists when each and every node is on both lists at the same time? So if we happen to be running the async worker we are processing nodes based on the prepared_list, at the same time if there is a concurent transaction commit happening then the exact some nodes are going to be processed from the node_list - it's not a functional problem but the presence of 2 lists and each node being on the same list at the same time just seems a bit redundant.

2. in btrfs_next_delayed_node can this code really trigger:

  if (!test_bit(BTRFS_DELAYED_NODE_IN_LIST, &node->flags)) { /* not in the list */

                 if (list_empty(&delayed_root->node_list))

                         goto out;

                 p = delayed_root->node_list.next;

In order for !test_bit(BTRFS_DELAYED_NODE_IN_LIST, &node->flags) to be true this means this node should have been btrfs_dequeue_delayed_node underneath us? Can this really happen e.g. have multiple concurrent __btrfs_run_delayed_items executions?

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
In reply to Qu Wenruo
Quoted 7 lines · Qu Wenruo
Quoted 2 lines · Nikolay Borisov

I've been studying the implementation of the delayed inodes feature and have a couple of questions.

Sorry I can't answer your question, but as you may already know by the rejection mail, Miao Xie has left Fujitsu and has been for several years.

Quoted 6 lines

And I'm not sure if he still checks btrfs mail list, so you may be on your own.

So to avoid such situation, it would be better to maintain a wiki page for such less maintained features, about it design principle and possible corner cases.

What is a less maintained feature? If it works as expected we don't need to touch the code, besided cleanups. Anyway, I did the review of delayed inodes back then and can possibly answer Nikolai's question.

Quoted 38 lines

This will make later developers quite happy. (personally speaking, this should be done before coding)

Thanks,
Qu

Quoted 20 lines

1. Why are there 2 lists when each and every node is on both lists at the same time? So if we happen to be running the async worker we are processing nodes based on the prepared_list, at the same time if there is a concurent transaction commit happening then the exact some nodes are going to be processed from the node_list - it's not a functional problem but the presence of 2 lists and each node being on the same list at the same time just seems a bit redundant.

2. in btrfs_next_delayed_node can this code really trigger:

  if (!test_bit(BTRFS_DELAYED_NODE_IN_LIST, &node->flags)) {
                 /* not in the list */
                 if (list_empty(&delayed_root->node_list))

                         goto out;

                 p = delayed_root->node_list.next;
Quoted 9 lines

In order for !test_bit(BTRFS_DELAYED_NODE_IN_LIST, &node->flags) to be true this means this node should have been btrfs_dequeue_delayed_node underneath us? Can this really happen e.g. have multiple concurrent __btrfs_run_delayed_items executions?
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html