Re: [PATCH net-next v2 2/3] af_unix: Do not wait for garbage collector in sendmsg()

Nam Cao <[email protected]>
Newsgroups dev.linux.lists.linux-rt-devel,dev.linux.lists.sashiko-reviews,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
[email protected] 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.