af_unix: Avoid Tarjan's algorithm if unnecessary.
commit ad081928 upstream. Once a cyclic reference is formed, we need to run GC to check if there is dead SCC. However, we do not need to run Tarjan's algorithm if we know that the shape of the inflight graph has not been changed. If an edge is added/updated/deleted and the edge's successor is inflight, we set false to unix_graph_grouped, which means we need to re-classify SCC. Once we finalise SCC, we set true to unix_graph_grouped. While unix_graph_grouped is true, we can iterate the grouped SCC using vertex->scc_entry in unix_walk_scc_fast(). list_add() and list_for_each_entry_reverse() uses seem weird, but they are to keep the vertex order consistent and make writing test easier. Signed-off-by:Kuniyuki Iwashima <kuniyu@amazon.com> Acked-by:
Paolo Abeni <pabeni@redhat.com> Link: https://lore.kernel.org/r/20240325202425.60930-12-kuniyu@amazon.com Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Lee Jones <lee@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading
-
mentioned in commit 2d79f856
-
mentioned in commit 144edd57
-
mentioned in commit 5688ed42
-
mentioned in commit 7d29ef7b
-
mentioned in commit bd87c75b
-
mentioned in commit d57d76db
-
mentioned in commit fee19dc6
-
mentioned in commit 5b12797b
-
mentioned in commit bd6c2f2f
-
mentioned in commit c8e90fed
-
mentioned in commit 93ec918b
-
mentioned in commit 082eed9a
-
mentioned in commit 45271a2c
Please sign in to comment