Re: [BAD PATCH 0/9] v4-aware tree walker API
- From
Nicolas Pitre <nico@fluxnic.net>
- Date
- Oct 12, 2013, 14:42 UTC
- Message-ID
- <alpine.LFD.2.03.1310121001000.3023@syhkavp.arg>
- In-Reply-To
- <20131011130528.GA10014@lanh>
On Fri, 11 Oct 2013, Duy Nguyen wrote:
Show 12 quoted lines
> On Fri, Oct 11, 2013 at 07:22:59PM +0700, Duy Nguyen wrote: > > > > Maybe we could make an exception and allow the tree walker to pass > > > > pv4_tree_cache* directly to decode_entries so it does not need to do > > > > the first lookup every time.. > > > > > > > > Suggestions? > > Looking at decode_entries() traces I think the "one decode_entries() > for one tree_entry()" just amplifies the delta chain effect. If you > hide 3 entries behind 5 layers of copy sequences > (i.e. tree1->tree2->..->tree5->real-tree-entry), then every > decode_entries(count=1) will have to go through 5 layers.
Calling decode_entries() for every tree entry is a bad approach. We should really implement this as a state machine preserving the entire state between entries so that moving to the next entry is just a matter of advancing a pointer in most cases.
Nicolas