From owner-svn-src-all@FreeBSD.ORG Sat Mar 28 08:34:54 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3B80E10; Sat, 28 Mar 2015 08:34:54 +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 B4C893CC; Sat, 28 Mar 2015 08:34:53 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t2S8YhoE029617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 28 Mar 2015 11:34:43 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t2S8YhdQ029616; Sat, 28 Mar 2015 11:34:43 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 28 Mar 2015 11:34:43 +0300 From: Gleb Smirnoff To: Fabien Thomas Subject: Re: svn commit: r280759 - head/sys/netinet Message-ID: <20150328083443.GV64665@FreeBSD.org> References: <201503271326.t2RDQxd3056112@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201503271326.t2RDQxd3056112@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Sat, 28 Mar 2015 08:34:54 -0000 On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote: F> Author: fabient F> Date: Fri Mar 27 13:26:59 2015 F> New Revision: 280759 F> URL: https://svnweb.freebsd.org/changeset/base/280759 F> F> Log: F> On multi CPU systems, we may emit successive packets with the same id. F> Fix the race by using an atomic operation. F> F> Differential Revision: https://reviews.freebsd.org/D2141 F> Obtained from: emeric.poupon@stormshield.eu F> MFC after: 1 week F> Sponsored by: Stormshield The D2141 says that benchmarking were done in presence of IPSEC, which of course is the bottleneck and performance of this instruction can't be benchmarked in its presence. Anyway, I believe that results of right benchmark would still show little difference between atomic and non-atomic increment of a shared value. I think we can use per-cpu ID counters, each CPU incrementing its own. If we start with random values, then probability of two packets with the same ID emitting at the allowed timeframe will be acceptably small. -- Totus tuus, Glebius.