Re: [PATCH net-next v2 2/3] af_unix: Do not wait for garbage collector in sendmsg()
From: Nam Cao
Date: Mon Jul 20 2026 - 03:26:35 EST
sashiko-bot@xxxxxxxxxx writes:
> [Severity: High]
> Does removing the unix_schedule_gc() call from unix_prepare_fpl() prevent
> proactive garbage collection of cyclic AF_UNIX file descriptors?
>
> If a long-running application creates a cycle of AF_UNIX sockets and closes
> its own file descriptors to them, the cycle maintains a positive f_count.
> Without this call triggering the garbage collector, the uncollected cyclic
> sockets could accumulate until the application reaches its RLIMIT_NOFILE
> quota, causing subsequent socket operations to fail.
Yes. But an application that creates a huge dead circle of AF_UNIX
sockets is already shady.
And keep scheduling the garbage collector can cause CPU consumption for
nothing, as shown in the v1 thread.
> Additionally, does this change leave the user parameter logic in
> unix_schedule_gc() as dead code?
Yes. That is cleaned up by PATCH 3/3.
Nam