From owner-svn-src-all@FreeBSD.ORG Thu Apr 10 19:30:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 859D7CDD; Thu, 10 Apr 2014 19:30:13 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A42F1A0F; Thu, 10 Apr 2014 19:30:12 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s3AJTb1D089651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Apr 2014 23:29:37 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s3AJTK2A089650; Thu, 10 Apr 2014 23:29:20 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 10 Apr 2014 23:29:20 +0400 From: Gleb Smirnoff To: John Baldwin , Julien Charbon Subject: Re: svn commit: r264321 - head/sys/netinet Message-ID: <20140410192920.GT44326@FreeBSD.org> References: <201404101815.s3AIFZx3065541@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404101815.s3AIFZx3065541@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: adrian@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, rrs@FreeBSD.org, rwatson@FreeBSD.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 19:30:13 -0000 Hi, one comment: On Thu, Apr 10, 2014 at 06:15:35PM +0000, John Baldwin wrote: J> +/* J> + * Drop a refcount on an tw elevated using tw_pcbref(). Return J> + * the tw lock released. J> + */ J> +static int J> +tw_pcbrele(struct tcptw *tw) J> +{ J> + J> + TW_WLOCK_ASSERT(V_tw_lock); J> + KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); J> + J> + if (!refcount_release(&tw->tw_refcount)) { J> + TW_WUNLOCK(V_tw_lock); J> + return (0); J> + } J> + J> + uma_zfree(V_tcptw_zone, tw); J> + TW_WUNLOCK(V_tw_lock); J> + return (1); J> +} We can unlock before uma_zfree(), that would reduce contention. Why do we need the lock in this function at all? We don't manipulate the TAILQ. -- Totus tuus, Glebius.