From: Christophe Gouault <christophe.gouault@6wind.com>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH ipsec-next 2/2] xfrm: configure policy hash table thresholds by /proc
Date: Mon, 19 May 2014 09:41:05 +0200 [thread overview]
Message-ID: <5379B591.6020001@6wind.com> (raw)
In-Reply-To: <20140515083447.GC32371@secunet.com>
On 05/15/2014 10:34 AM, Steffen Klassert wrote:
> On Mon, May 12, 2014 at 03:45:25PM +0200, Christophe Gouault wrote:
>> Enable to specify local and remote prefix length thresholds
>> for the policy hash table via /proc entries. Example:
>>
>> echo 0 24 > /proc/sys/net/ipv4/xfrm4_policy_hash_tresh
>> echo 0 56 > /proc/sys/net/ipv6/xfrm6_policy_hash_tresh
>
> I would not like to have this configurable from userspace.
> Fist of all, a good threshold depends on the IPsec configuration
> and can change during runtime. So it is not obvious for a user
> which values are good for his configuration. Most users will
> just leave the default, so they will not benefit from your
> changes.
Hi Steffen,
Like for several other /proc entries, the default values are suitable
for simple use cases and users can let them unchanged. Users usually
only start tuning them when they have a specific use case (typically
scalability needs).
Moreover, I am concerned that any heuristic for automatic changes would
be a performance killer when the system is flapping. See below.
> Second, on the long run we have to remove the IPsec flowcache
> as this has the same limitation as our routing cache had.
> To do this, we need to replace the hashlist based policy and
> state lookups by a well performing lookup algorithm and I
> would like to do that without any user visible changes.
Efficient lookup is a field we have studied for long in my company.
There are many thesis about multi-field classification, but none enables
to cover all use cases. All suffer from limitations (building time,
memory consumption, number of fields, time and memory
unpredictability...) and each is adapted to a specific use case.
The best seems to offer several methods and enable to select and tune
them according to the use case.
The main advantage of the hash table with configurable thresholds is
that it enables to cover a wide variety of use cases by adjusting the
thresholds. And we have the benefit of "keep it simple".
> Can't we tune the hash threshold internally? We could maintain
> a per hashlist policy counter. If we have 'many' policies and
> most of these policies are in the same hashlist we could change
> the hash threshold. We could check this when we add policies
> and update the hash threshold if needed.
I think that finding a generic algorithm to determine a good tradeof for
the local and remote thresholds is quite tough. I'm afraid tracking the
number of entries in each hlist is not enough. It would help to trigger
a change, but not to choose the new values. Thresholds both
determine which SPs will actually be hashed (vs. ones that will just be
enqueued in the inexact list) and the number of bits that will be
included in the hash key (and hence the entropy of the key). Moreover,
it is a pair of thresholds, which makes the choice even harder.
A user who knows what his SPD contains would probably prefer to be able
to tune the hash thresholds instead of relying on an uncontrolled,
automatic algorithm.
Exporting a userland API (here by /proc) enables a user or a daemon to
choose a strategy according to information the kernel does not
necessarily have, and enables to implement various (possibly complex)
policies.
> Everything else looks pretty good, thanks!
>
You're welcome :)
next prev parent reply other threads:[~2014-05-19 7:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-12 13:45 [PATCH ipsec-next 0/2] xfrm: scalability enhancements for policy database Christophe Gouault
2014-05-12 13:45 ` [PATCH ipsec-next 1/2] xfrm: hash prefixed policies based on preflen thresholds Christophe Gouault
2014-05-12 13:45 ` [PATCH ipsec-next 2/2] xfrm: configure policy hash table thresholds by /proc Christophe Gouault
2014-05-15 8:34 ` Steffen Klassert
2014-05-19 7:41 ` Christophe Gouault [this message]
2014-05-22 10:09 ` Steffen Klassert
2014-05-22 10:15 ` David Laight
2014-05-23 8:30 ` Christophe Gouault
2014-08-01 9:12 ` [PATCH net-next v2 0/2] xfrm: scalability enhancements for policy database Christophe Gouault
2014-08-01 9:12 ` [PATCH net-next v2 1/2] xfrm: hash prefixed policies based on preflen thresholds Christophe Gouault
2014-08-01 9:12 ` [PATCH net-next v2 2/2] xfrm: configure policy hash table thresholds by netlink Christophe Gouault
2014-08-01 13:01 ` [PATCH RFC iproute2 0/2] ipxfrm: configuration of SPD hash Christophe Gouault
2014-08-01 13:01 ` [PATCH RFC iproute2 1/2] Update headers to net-next Christophe Gouault
2014-08-01 13:01 ` [PATCH RFC iproute2 2/2] ipxfrm: add command for configuring SPD hash table Christophe Gouault
2014-08-21 6:09 ` [PATCH net-next v2 2/2] xfrm: configure policy hash table thresholds by netlink Steffen Klassert
2014-08-26 7:27 ` Christophe Gouault
2014-08-27 15:48 ` [PATCH ipsec-next v3 0/2] xfrm: scalability enhancements for policy database Christophe Gouault
2014-08-27 15:48 ` [PATCH ipsec-next v3 1/2] xfrm: hash prefixed policies based on preflen thresholds Christophe Gouault
2014-08-27 15:48 ` [PATCH ipsec-next v3 2/2] xfrm: configure policy hash table thresholds by netlink Christophe Gouault
2014-08-29 9:54 ` Steffen Klassert
2014-08-29 10:02 ` Christophe Gouault
2014-08-29 14:16 ` [ipsec-next v4 0/2] xfrm: scalability enhancements for policy database Christophe Gouault
2014-08-29 14:16 ` [ipsec-next v4 1/2] xfrm: hash prefixed policies based on preflen thresholds Christophe Gouault
2014-08-29 14:16 ` [ipsec-next v4 2/2] xfrm: configure policy hash table thresholds by netlink Christophe Gouault
2014-09-03 11:59 ` [ipsec-next v4 0/2] xfrm: scalability enhancements for policy database Steffen Klassert
2014-09-03 12:53 ` Christophe Gouault
2014-08-04 22:09 ` [PATCH net-next v2 " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5379B591.6020001@6wind.com \
--to=christophe.gouault@6wind.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.