taskqueue for pf periodic events
Max Laier
max at love2party.net
Tue Mar 7 21:15:43 UTC 2006
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
think I even sent you a patch to expire only a fixed amount of states at
once. Can't find that patch now, do you remember? OpenBSD has by now done
something along those lines and I will import it as soon as 3.9 is ready and
I have some time. Could you change the purge part to a kernel thread like
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 would
certainly make my life easier.
Thanks for coming up with this!
--
/"\ Best regards, | mlaier at freebsd.org
\ / Max Laier | ICQ #67774661
X http://pf4freebsd.love2party.net/ | mlaier at EFnet
/ \ ASCII Ribbon Campaign | Against HTML Mail and News
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20060307/c0393871/attachment.bin
More information about the freebsd-net
mailing list