Re: [PATCH net-next v3 1/3] af_unix: Schedule the garbage collector at task exit
From: Nam Cao
Date: Wed Jul 29 2026 - 11:54:57 EST
Paolo Abeni <pabeni@xxxxxxxxxx> writes:
> Sashiko noted this can cause relevant regressions:
>
> https://sashiko.dev/#/patchset/cover.1784712370.git.namcao%40linutronix.de
>
> Generally speaking hooking the unix GC at task exit time does not feel
> right (layering violation). Perhaps scheduling the GC with a reasonable
> timeout in unix_update_graph() would be better?
unix_update_graph() doesn't work. In the reproducer, the sockets'
refcount do not drop to zero and unix_update_graph() is not called.
Thinking about this again, I am tempted to add a close() call back to
struct file_operations and we schedule the GC (with some timeout) in
that callback.
Or we can also periodically run the GC. Or we just ignore this issue, it
is capped by RLIMIT_NOFILE anyway.
I don't really like any of the option. If someone has an idea, please do
let me know.
Nam