Re: [PATCH net-next v4 1/1] af_unix: Do not wait for garbage collector in sendmsg()
Kuniyuki Iwashima <[email protected]>
| Newsgroups | dev.linux.lists.linux-rt-devel,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <CAAVpQUC5mY9gZH=LmRvdZb1F+QbxGPuNBgSXvHh6pTzZO5QSNQ@mail.gmail.com> |
On Fri, Aug 7, 2026 at 6:07 PM Jakub Kicinski <[email protected]> wrote: > > On Tue, 4 Aug 2026 08:46:16 +0200 Nam Cao wrote: > > AF_UNIX sockets' sendmsg() schedules and blocks on the garbage collector if > > user has too many inflight unix sockets and there is cyclic reference in > > the system. This causes real-time issues, as cyclic reference can be > > created by any task in the system, and high priority tasks who do need to > > send lots of AF_UNIX sockets get blocked by the garbage collector which > > runs as workqueue, causing a priority inversion scenario. > > Hi Kuniyuki! Any thoughts? flush_work() makes an insane process slow down by itself and the sane users (whose peers receive fd in timely manner) can likely acquire the gc lock before insane users. The commit message assumes the GC is low priority, and it will be easier to trigger OOM and soft lockup without the penalty. If priority inversion on RT kernel is the only problem here, there will be more flush_work() instances triggered from userspace, and the real problem is that flush_work() does not implement priority inheritance like mutex.