Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2006 22:13:21 +0100
From:      Max Laier <max@love2party.net>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        net@freebsd.org, scottl@freebsd.org, dhartmei@freebsd.org
Subject:   Re: taskqueue for pf periodic events
Message-ID:  <200603072213.29904.max@love2party.net>
In-Reply-To: <20060307105938.GH1102@cell.sick.ru>
References:  <20060307105938.GH1102@cell.sick.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603072213.29904.max>