Moritz's relay spends a lot of time in circuit_unlink_all_from_orconn, which does a linear walk over the entire circuit list.
To make this faster, we'll need data structures. Currently, each or_connection has a doubly-linked list of its active circuits, but not of all its circuits. Adding such a doubly-linked-list is the obvious solution.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
If we want to be able to unlink circuit_t without the need of walking through all of the circuits, first we need to make global_circuitlist a doubly-linked list. Attached patch does just that, and improves some other minor things:
Doesn't expose global_circuitlist via 'extern', instead calls circuit_get_global_list_() to get the structure.
Removes unused circuit_dump_by_chan and its helper circuit_dump_chan_details.
Adds #include tor_queue.h to or.h as it's needed.
I don't think this patch is enough to "resolve" this bug, but is definitely necessary.
If we want to be able to unlink circuit_t without the need of walking through all of the circuits, first we need to make global_circuitlist a doubly-linked list. Attached patch does just that, and improves some other minor things:
Doesn't expose global_circuitlist via 'extern', instead calls circuit_get_global_list_() to get the structure.
This should be a separate commit/patch, before your other changes.
Removes unused circuit_dump_by_chan and its helper circuit_dump_chan_details.
This should be not only a separate commit/patch, but a separate Trac ticket. (Perhaps the real bug here is that those functions are unused.)
Adds #include tor_queue.h to or.h as it's needed.
I don't think this patch is enough to "resolve" this bug, but is definitely necessary.
After reading the description of this bug again, I don't think my patch has much to do with it. Sorry. Let's move the discussion to #9107 (moved) and #9108 (moved) .