From owner-freebsd-stable@FreeBSD.ORG Wed Nov 14 16:06:38 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2890BEE5 for ; Wed, 14 Nov 2012 16:06:38 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 05C9A8FC08 for ; Wed, 14 Nov 2012 16:06:38 +0000 (UTC) Received: from [10.250.10.104] (3.sub-174-254-232.myvzw.com [174.254.232.3]) by elvis.mu.org (Postfix) with ESMTPSA id 780401A3CC2; Wed, 14 Nov 2012 08:06:37 -0800 (PST) References: <6908B498-6978-4995-B081-8D504ECB5C0A@hostpoint.ch> <007F7A73-75F6-48A6-9C01-E7C179CDA48A@hostpoint.ch> <50A3104E.5000107@mu.org> <4DDA6862-6BE5-4EF4-B6B5-141DD9123C36@hostpoint.ch> In-Reply-To: <4DDA6862-6BE5-4EF4-B6B5-141DD9123C36@hostpoint.ch> Mime-Version: 1.0 (1.0) Message-Id: <6177E5C2-7FF6-42D7-B1E0-C09803BF6383@mu.org> X-Mailer: iPhone Mail (9B206) From: Alfred Perlstein Subject: Re: thread taskq / unp_gc() using 100% cpu and stalling unix socket IPC Date: Wed, 14 Nov 2012 08:06:33 -0800 To: Markus Gebert Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2012 16:06:38 -0000 On Nov 14, 2012, at 2:42 AM, Markus Gebert wrot= e: >=20 > On 14.11.2012, at 04:30, Alfred Perlstein wrote: >=20 >> A couple of ideas: >=20 > Thanks. >=20 >> 1) convert the taskqueue to a callout, but only allow one to be queued at= a time. set the granularity. >=20 > I think Konstantin's patch is going in this direction. Yes. Looks good.=20 >=20 >=20 >> 2) I think you only need to actually run garbage collection on the off-ch= ance that you pass unix file descriptors, otherwise you can get away with re= fcounting. >=20 > Hm, isn't that whats done currently? gc is only scheduled if fds are infli= ght while uipc_detach() is called. >=20 It looks to me as if it runs the gc when ANY type are in flight.=20 If you added refcounting then you could trust the refcounting so long as no u= nix sockets were in flight as its only the unix sockets that can cause cycle= s in a refcount based graph.=20 >=20 >> It's hard for me to express the exact logic needed for this though. I t= hink you would need some way to simply do refcounting until there was a unix= socket descriptor in flight, then switch to gc. Either that or make a sys= ctl that allows you administratively deny passing of unix descriptors and ju= st use refcounting. >=20 >=20 >=20 > Markus >=20