netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] caching bundles instead of policies
@ 2010-03-25  9:24 Timo Teras
  2010-03-25  9:24 ` [PATCH RFC 1/2] flow: virtualize get and entry deletion methods Timo Teras
  2010-03-25  9:24 ` [PATCH RFC 2/2] xfrm: cache bundles instead of policies for outgoing flows Timo Teras
  0 siblings, 2 replies; 22+ messages in thread
From: Timo Teras @ 2010-03-25  9:24 UTC (permalink / raw)
  To: netdev; +Cc: Herbert Xu, Timo Teras

This is not yet intended for commit (see below), but rather a
snapshot of what I'm working with currently. And to get some feedback
on the direction where I'm going.

The first patch changes flow cache reference counting fundamentally.
It no longer assumes that the cached objects are GC'd later, but instead
calls the virtualized delete method to delete (or drop it's reference).
This does now mean that ->delete() call can be slowish. The plan is to
add ->check() which is called when ever the cache is flushed, add all
deleted entries to GC list, and have the main flush routine delete the
GC list entries.

I wanted to suggest this because:
 - xfrm_policy_put() is currently never guaranteed to be fast, instead
   it can always result to slow path. Only the flow cache wanted to have
   fast free when bh is disabled, and this was made possible with the
   policy GC ensuring that cache is flushed before policies are freed.
 - now that we can cache bundles or policies, it makes sense to have
   more selective flushing; otherwise we lose some of the speed ups.
   This also means that flushing gets faster, and is needed very rarely
   (sensible points are GC'ing bundles and when interface goes down)
 - now we don't have to do two periodic/delayed GC's: one for bundles,
   and one for policies. instead we can have central code for that in
   the flow cache. this also means that the flow cache hash is the
   owner of bundle, and when the flow cache entry is expired the bundle
   is dst_free()'d (which we would want to do anyway). no need to keep
   bundles in separate global (or policy specific) list

Does this sound acceptable approach?

What the current patch set is missing:
 - delayed deletion of flow cache objects
 - doing check() on flush for each object
 - removing the policy GC
 - some of the other flow cache improvements from my original patch

Also, we might want to cache dummy bundles in xfrm_check_policy().
The reason is that if we matched sub policy originally, we always have
to do O(n) search for the main policy.

Timo Teras (2):
  flow: virtualize get and entry deletion methods
  xfrm: cache bundles instead of policies for outgoing flows

 include/net/flow.h      |   17 +-
 include/net/xfrm.h      |   12 +-
 net/core/flow.c         |  102 ++++---
 net/ipv4/xfrm4_policy.c |   22 --
 net/ipv6/xfrm6_policy.c |   31 --
 net/xfrm/xfrm_policy.c  |  755 +++++++++++++++++++++++++----------------------
 6 files changed, 471 insertions(+), 468 deletions(-)


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-03-29 12:45 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25  9:24 [PATCH RFC 0/2] caching bundles instead of policies Timo Teras
2010-03-25  9:24 ` [PATCH RFC 1/2] flow: virtualize get and entry deletion methods Timo Teras
2010-03-25 19:26   ` David Miller
2010-03-26  6:17     ` Timo Teräs
2010-03-29  8:40     ` Herbert Xu
2010-03-29  9:00       ` Timo Teräs
2010-03-29  9:09         ` Herbert Xu
2010-03-29 10:07           ` Timo Teräs
2010-03-29 10:26             ` Herbert Xu
2010-03-29 10:36               ` Timo Teräs
2010-03-29 11:10                 ` Herbert Xu
2010-03-29 11:23                   ` Timo Teräs
2010-03-29 11:32                     ` Herbert Xu
2010-03-29 11:39                       ` Timo Teräs
2010-03-29 11:57                         ` Herbert Xu
2010-03-29 12:03                           ` Timo Teräs
2010-03-29 12:11                             ` Herbert Xu
2010-03-29 12:20                               ` Timo Teräs
2010-03-29 12:25                                 ` Herbert Xu
2010-03-29 12:33                                   ` Timo Teräs
2010-03-29 12:45                                     ` Herbert Xu
2010-03-25  9:24 ` [PATCH RFC 2/2] xfrm: cache bundles instead of policies for outgoing flows Timo Teras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).