Home
last modified time | relevance | path

Searched hist:"6 ba76fd2848e107594ea4f03b737230f74bc23ea" (Results 1 – 2 of 2) sorted by relevance

/linux/net/unix/
H A Dgarbage.cdiff 6ba76fd2848e107594ea4f03b737230f74bc23ea Mon Mar 25 21:24:15 CET 2024 Kuniyuki Iwashima <kuniyu@amazon.com> af_unix: Iterate all vertices by DFS.

The new GC will use a depth first search graph algorithm to find
cyclic references. The algorithm visits every vertex exactly once.

Here, we implement the DFS part without recursion so that no one
can abuse it.

unix_walk_scc() marks every vertex unvisited by initialising index
as UNIX_VERTEX_INDEX_UNVISITED and iterates inflight vertices in
unix_unvisited_vertices and call __unix_walk_scc() to start DFS from
an arbitrary vertex.

__unix_walk_scc() iterates all edges starting from the vertex and
explores the neighbour vertices with DFS using edge_stack.

After visiting all neighbours, __unix_walk_scc() moves the visited
vertex to unix_visited_vertices so that unix_walk_scc() will not
restart DFS from the visited vertex.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/20240325202425.60930-6-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/linux/include/net/
H A Daf_unix.hdiff 6ba76fd2848e107594ea4f03b737230f74bc23ea Mon Mar 25 21:24:15 CET 2024 Kuniyuki Iwashima <kuniyu@amazon.com> af_unix: Iterate all vertices by DFS.

The new GC will use a depth first search graph algorithm to find
cyclic references. The algorithm visits every vertex exactly once.

Here, we implement the DFS part without recursion so that no one
can abuse it.

unix_walk_scc() marks every vertex unvisited by initialising index
as UNIX_VERTEX_INDEX_UNVISITED and iterates inflight vertices in
unix_unvisited_vertices and call __unix_walk_scc() to start DFS from
an arbitrary vertex.

__unix_walk_scc() iterates all edges starting from the vertex and
explores the neighbour vertices with DFS using edge_stack.

After visiting all neighbours, __unix_walk_scc() moves the visited
vertex to unix_visited_vertices so that unix_walk_scc() will not
restart DFS from the visited vertex.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/20240325202425.60930-6-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>