From owner-freebsd-net@FreeBSD.ORG Wed Aug 14 12:03:23 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E5DAEE4F for ; Wed, 14 Aug 2013 12:03:23 +0000 (UTC) (envelope-from vsevolod@FreeBSD.org) Received: from n.highsecure.ru (n.highsecure.ru [178.32.219.154]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF98224C8 for ; Wed, 14 Aug 2013 12:03:23 +0000 (UTC) Received: from medway.cl.cam.ac.uk (medway.cl.cam.ac.uk [128.232.64.24]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: vsevolod@highsecure.ru) by n.highsecure.ru (Postfix) with ESMTPSA id 186FA2201F3; Wed, 14 Aug 2013 13:02:08 +0100 (BST) Message-ID: <520B7201.4060507@FreeBSD.org> Date: Wed, 14 Aug 2013 13:03:13 +0100 From: Vsevolod Stakhov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: ng_ipacct locking rework Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Roman V. Palagin" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Aug 2013 12:03:24 -0000 Hello, I've reworked the locking model of the ng_ipacct module (ports/net-mgmt/ng_ipacct) for better parallel access support. I did the following: - convert locking from a global mutex to hash bucket level locks; - convert a mutex to rmlock (as ip accounting data is mostly read from the hash from my observations). I appreciate if somebody could review/test this patch and thus I can commit it to the port afterwards. The patches themselves are here: http://highsecure.ru/patch-ng_ipacct.c http://highsecure.ru/patch-ng_ipacct_hash.h Or for comfortable viewing are mirrored on gist: https://gist.github.com/vstakhov/6223170 -- Vsevolod Stakhov