From owner-svn-src-all@FreeBSD.ORG Wed Feb 19 20:02:53 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 5E87EA6D; Wed, 19 Feb 2014 20:02:53 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB9ED1DE7; Wed, 19 Feb 2014 20:02:52 +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 s1JK2o36077802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 20 Feb 2014 00:02:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s1JK2oFA077801; Thu, 20 Feb 2014 00:02:50 +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, 20 Feb 2014 00:02:50 +0400 From: Gleb Smirnoff To: Mikolaj Golub Subject: Re: svn commit: r262196 - head/sys/netpfil/pf Message-ID: <20140219200250.GB77637@FreeBSD.org> References: <201402182217.s1IMHCeM077356@svn.freebsd.org> <20140219184859.GA3844@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140219184859.GA3844@gmail.com> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Martin Matuska 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: Wed, 19 Feb 2014 20:02:53 -0000 On Wed, Feb 19, 2014 at 08:49:01PM +0200, Mikolaj Golub wrote: M> > -SLIST_HEAD(pf_overload_head, pf_overload_entry); M> > +struct pf_overload_head { M> > + SLIST_HEAD(, pf_overload_entry) head; M> > + struct vnet *vnet; M> > +}; M> > static VNET_DEFINE(struct pf_overload_head, pf_overloadqueue); M> > #define V_pf_overloadqueue VNET(pf_overloadqueue) M> M> ... M> M> > - SLIST_INIT(&V_pf_overloadqueue); M> > + SLIST_INIT(&V_pf_overloadqueue.head); M> > TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue); M> > + V_pf_overloadqueue.vnet = curvnet; M> M> Why not pass vnet as a context to pf_overload_task instead of M> &V_pf_overloadqueue? Then you would not need this hack with storing a M> vnet inside a vnet variable. Yes, that would look much better. The pf_overloadqueue can be made global after that. Its lock is already global. -- Totus tuus, Glebius.