dhcpcd-discuss

Re: [RFC]Routes are stored as a linked list

Donald Sharp

Mon Mar 04 17:37:40 2019

Roy -

Without the rb-tree dhcpcd is taking up this much space after 1
million routes install/delete:

sharpd@janelle ~/d/src> ps -eo size,pid,user,command | grep dhcpcd
16672 27438 root     /usr/sbin/dhcpcd

With the rb-tree dhcpcd is taking up this much space:

sharpd@janelle ~/d/src> ps -eo size,pid,user,command | grep dhcpcd
172232 26445 root    dhcpcd/src/dhcpcd

So not great at all and it would be nice to understand what is going on.

On the other hand original non-rbtree code continues to grow after
every iteration of 1 million routes:

<another 1 million routes added/deleted>
sharpd@janelle ~/d/src> ps -eo size,pid,user,command | grep dhcpcd
27088 27438 root     /usr/sbin/dhcpcd
<another 1 million routes added/deleted>
sharpd@janelle ~/d/src> ps -eo size,pid,user,command | grep dhcpcd
35024 27438 root     /usr/sbin/dhcpcd

While the new rb-tree code is staying at 172mb for each iteration, so
there is that at least.  I think it might be worthwhile to figure out
where all the extra memory is going to.  It seems like a simple data
structure replacement shouldn't have these memory issues.  I guess
some more investigation is needed.  I'll see if I can look at it this
evening some more.

donald




On Mon, Mar 4, 2019 at 11:39 AM Roy Marples <roy@xxxxxxxxxxxx> wrote:
>
> On 04/03/2019 15:31, Donald Sharp wrote:
> > Roy -
> >
> > Things look much better( even better than my initial swag at it )
> > Install/remove 1million routes:
> >
> > sharpd@janelle:~$ ps -ef | grep dhcpcd
> > root     26445     1 15 15:27 ?        00:00:23 dhcpcd/src/dhcpcd
> > sharpd   26469 26377  0 15:30 pts/4    00:00:00 grep dhcpcd
> > sharpd@janelle:~$
> >
> > Thanks for taking this up and fixing it.  Huge improvement in runtime!
>
> Nice!
>
> I've made some final changes to the rbtree implementation to silence all
> current compiler warnings as well.
>
> How is the memory usage compared to your initial patch? Is it now
> "acceptable" for such a large routing table?
>
> Roy

Follow-Ups:
Re: [RFC]Routes are stored as a linked listRoy Marples
References:
[RFC]Routes are stored as a linked listDonald Sharp
Re: [RFC]Routes are stored as a linked listRoy Marples
Re: [RFC]Routes are stored as a linked listDonald Sharp
Re: [RFC]Routes are stored as a linked listRoy Marples
Re: [RFC]Routes are stored as a linked listRoy Marples
Re: [RFC]Routes are stored as a linked listDonald Sharp
Re: [RFC]Routes are stored as a linked listRoy Marples
Re: [RFC]Routes are stored as a linked listDonald Sharp
Re: [RFC]Routes are stored as a linked listDonald Sharp
Re: [RFC]Routes are stored as a linked listDonald Sharp
Re: [RFC]Routes are stored as a linked listRoy Marples
Re: [RFC]Routes are stored as a linked listDonald Sharp
Re: [RFC]Routes are stored as a linked listRoy Marples
Archive administrator: postmaster@marples.name