Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Mar 2013 13:14:16 +0100
From:      =?ISO-8859-1?Q?Ermal_Lu=E7i?= <eri@freebsd.org>
To:        Kajetan Staszkiewicz <vegeta@tuxpowered.net>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, "freebsd-pf@freebsd.org" <freebsd-pf@freebsd.org>
Subject:   Re: [patch] Source entries removing is awfully slow.
Message-ID:  <CAPBZQG0Jj_c-XvVJNV2S02xcitr%2Bnhs%2BmV=GjJm3YeM6iPUX7g@mail.gmail.com>
In-Reply-To: <201303082151.00895.vegeta@tuxpowered.net>
References:  <201303081419.17743.vegeta@tuxpowered.net> <CAPBZQG2bb2xzPB2UoPUDx-ifyBdmjac6b8kV76DTPBUzLCDmJw@mail.gmail.com> <201303082151.00895.vegeta@tuxpowered.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--047d7bea40f00ef2e504d77ce15b
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 8, 2013 at 9:51 PM, Kajetan Staszkiewicz
<vegeta@tuxpowered.net>wrote:

> Dnia pi=B1tek, 8 marca 2013 o 21:11:43 Ermal Lu=E7i napisa=B3(a):
> > Is this FreeBSD 9.x or HEAD?
>
> I found the problem and developed the patch on 9.1.
>
> Can you please test this more 'beautiful' patch.
Its similar to yours but also delays src state removal to the proper purge
thread.

Though the src node removal option through pfctl -K does a lot of job to
cleanup things
Still need to undertand why it takes so much time for you to loop through
500K states.
The purge thread does that every tick by partitioning it to a few per time
slot but still minutes is way loong.

Can you please try to give a top -SH view of the time when this happens and
a pfctl -vvsa output?



> --
> | pozdrawiam / greetings | powered by Debian, CentOS and FreeBSD |
> |  Kajetan Staszkiewicz  | jabber,email: vegeta()tuxpowered net  |
> |        Vegeta          | www: http://vegeta.tuxpowered.net     |
> `------------------------^---------------------------------------'
>



--=20
Ermal

--047d7bea40f00ef2e504d77ce15b
Content-Type: application/octet-stream; 
	name="state_unlink_optimization2.diff"
Content-Disposition: attachment; filename="state_unlink_optimization2.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_he2q1w430

ZGlmZiAtLWdpdCBhL3N5cy9jb250cmliL3BmL25ldC9wZi5jIGIvc3lzL2NvbnRyaWIvcGYvbmV0
L3BmLmMKaW5kZXggOWZiMDVhZS4uNGRmNDBjYyAxMDA2NDQKLS0tIGEvc3lzL2NvbnRyaWIvcGYv
bmV0L3BmLmMKKysrIGIvc3lzL2NvbnRyaWIvcGYvbmV0L3BmLmMKQEAgLTcyMCw2ICs3MjAsOSBA
QCBwZl9pbnNlcnRfc3JjX25vZGUoc3RydWN0IHBmX3NyY19ub2RlICoqc24sIHN0cnVjdCBwZl9y
dWxlICpydWxlLAogCQkgICAgcnVsZS0+bWF4X3NyY19jb25uX3JhdGUubGltaXQsCiAJCSAgICBy
dWxlLT5tYXhfc3JjX2Nvbm5fcmF0ZS5zZWNvbmRzKTsKIAorI2lmZGVmIF9fRnJlZUJTRF9fCisJ
CVRBSUxRX0lOSVQoJigqc24pLT5zdGF0ZV9saXN0KTsKKyNlbmRpZgogCQkoKnNuKS0+YWYgPSBh
ZjsKIAkJaWYgKHJ1bGUtPnJ1bGVfZmxhZyAmIFBGUlVMRV9SVUxFU1JDVFJBQ0sgfHwKIAkJICAg
IHJ1bGUtPnJwb29sLm9wdHMgJiBQRl9QT09MX1NUSUNLWUFERFIpCkBAIC0xNDUzLDYgKzE0NTYs
OSBAQCBwZl9wdXJnZV9leHBpcmVkX3NyY19ub2RlcyhpbnQgd2FzbG9ja2VkKQogI2VuZGlmCiB7
CiAJc3RydWN0IHBmX3NyY19ub2RlCQkqY3VyLCAqbmV4dDsKKyNpZmRlZiBfX0ZyZWVCU0RfXwor
CXN0cnVjdCBwZl9zdGF0ZQkJCSpzOworI2VuZGlmCiAJaW50CQkJCSBsb2NrZWQgPSB3YXNsb2Nr
ZWQ7CiAKICNpZmRlZiBfX0ZyZWVCU0RfXwpAQCAtMTQ4Ni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