From owner-freebsd-net@FreeBSD.ORG Tue Mar 7 21:15:43 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 782CE16A420; Tue, 7 Mar 2006 21:15:43 +0000 (GMT) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id D398443D48; Tue, 7 Mar 2006 21:15:42 +0000 (GMT) (envelope-from max@love2party.net) Received: from [84.163.240.171] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu10) with ESMTP (Nemesis), id 0ML31I-1FGjWv39EK-0003Z7; Tue, 07 Mar 2006 22:15:42 +0100 From: Max Laier Organization: FreeBSD To: Gleb Smirnoff Date: Tue, 7 Mar 2006 22:13:21 +0100 User-Agent: KMail/1.9.1 References: <20060307105938.GH1102@cell.sick.ru> In-Reply-To: <20060307105938.GH1102@cell.sick.ru> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart8359048.izo0kcR7tf"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200603072213.29904.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: net@freebsd.org, scottl@freebsd.org, dhartmei@freebsd.org Subject: Re: taskqueue for pf periodic events 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: Tue, 07 Mar 2006 21:15:43 -0000 --nextPart8359048.izo0kcR7tf Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Gleb, On Tuesday 07 March 2006 11:59, Gleb Smirnoff wrote: > running a pf load balancer I have noticed that the "swi4: clock" > process consumes a noticable amount of CPU time, when a lot of > states are purged from pf cache. The load balancer is also running > CARP, and a hot spare is working here too. Reading daily run outputs > from the second router, I have noticed that a few times per day > the redundant router preempts the main one, since it doesn't > receive announcement in time from master. So, I had a theory that > a heavy pf purge is running so long, that a CARP announcement > is delayed. You know, all callout(9) events are serialized in one > thread - "swi4: clock". > > So I made a patch that moves all periodic pf(4) job into separate > context. The patch uses new taskqueue API made by Scott. I have > ported the API to RELENG_6 and made my patch for RELENG_6. I've > been running the patch for 27 days and the spurious preemtions > of CARP backup had gone away. No problems were noticed. The box > is running SMP kernel on a single CPU box with HTT (2 logical > CPUs), HTT enabled. > > The patch attached. Makes sense to me. I recall that we talked about this problem before and I= =20 think I even sent you a patch to expire only a fixed amount of states at=20 once. Can't find that patch now, do you remember? OpenBSD has by now done= =20 something along those lines and I will import it as soon as 3.9 is ready an= d=20 I have some time. Could you change the purge part to a kernel thread like= =20 done in OpenBSD: http://www.openbsd.org/cgi-bin/cvsweb/src/sys/net/pf.c#rev1.498 I'm not sure which is better, but staying close to the OpenBSD sollution wo= uld=20 certainly make my life easier. Thanks for coming up with this! =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart8359048.izo0kcR7tf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBEDfd5XyyEoT62BG0RAoslAJ95YJO3uS89vJg2dKIkxrBeIjM6/ACeNzoL CldaqM1X/vtWon4gz5Y+jf0= =13aE -----END PGP SIGNATURE----- --nextPart8359048.izo0kcR7tf--