From owner-freebsd-net@FreeBSD.ORG Mon Sep 1 12:04:54 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAB0510656D9 for ; Mon, 1 Sep 2008 12:04:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id B42D18FC17 for ; Mon, 1 Sep 2008 12:04:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 3C2EC46C4E; Mon, 1 Sep 2008 08:04:54 -0400 (EDT) Date: Mon, 1 Sep 2008 13:04:54 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Anton Yuzhaninov In-Reply-To: <48AEDC40.6030901@citrin.ru> Message-ID: References: <48AEDC40.6030901@citrin.ru> User-Agent: Alpine 1.10 (BSF 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org Subject: Re: bug in unix sockets garbage collector X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2008 12:04:54 -0000 On Fri, 22 Aug 2008, Anton Yuzhaninov wrote: > On servers where used unix sockets, sometimes thread taskq start to eat 100% > CPU: http://docs.FreeBSD.org/cgi/mid.cgi?474EFC5C.9060508 > > Addition info about this problem - when this occurs > > sysctl net.local.inflight show negative number. > > % sysctl net.local.inflight net.local.inflight: -3 > > And this condition become always true: > > if (local_unp_rights) > taskqueue_enqueue(taskqueue_thread, &unp_gc_task); > > It seems, that unp_rights decremented more often than incremented, or some > race exist. Hi Anton: On reviewing this code, I've identified at least one race condition that could lead to the behavior that you've spotted. It will probably take me a couple of days to produce a patch for you to try. However, could I ask you to file a PR for this problem, with the above and any related diagnostics, and when you receive the e-mail PR receipt, could you forward it to me so that I can take ownership of it? Thanks, Robert N M Watson Computer Laboratory University of Cambridge