Re: [BAD PATCH 0/9] v4-aware tree walker API
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Oct 12, 2013, 15:59 UTC
- Message-ID
- <CACsJy8DZvdWyKSvLzPhS7OqKUU-OKG40M7M1HxN4eADsx0od6Q@mail.gmail.com>
- In-Reply-To
- <alpine.LFD.2.03.1310121001000.3023@syhkavp.arg>
On Sat, Oct 12, 2013 at 9:42 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
Show 19 quoted lines
> On Fri, 11 Oct 2013, Duy Nguyen wrote: > >> 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.
Yeah. Maybe first step is avoid recursion in decode_entries(). We need to do that eventually to avoid stack overlow due to long depths.
-- Duy