From: "Ted Unangst" Subject: Re: Use a FIFO for the reaper To: "Claudio Jeker" Cc: "Martin Pieuchot" , tech@openbsd.org Date: Thu, 15 May 2025 14:47:10 -0400 On 2025-05-15, Claudio Jeker wrote: > On Thu, May 15, 2025 at 02:06:39PM -0400, Ted Unangst wrote: > > On 2025-05-14, Martin Pieuchot wrote: > > > Instead of adding dead threads at the head of the deadproc list insert > > > them at the tail. > > > > > > This improve latency and reduce variance when building with 24 CPUs. > > > > Any theories why? I would think, if it mattered, a LIFO would be more > > cache friendly. > > Because signaling to the parent is done in the reaper right now. So if you > have sh executing printf and then 20 cc exit right after you want printf > to be reaped first and not wait for 20 cc processes to cleanup. > I think overall a fifo is fairer in that regard since the first entry can > not starve on the queue. oh, that makes sense.