Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Quagga: Dev

[RFC PATCH 00/25] Mostly bgpd optimizations

 

 

Quagga dev RSS feed   Index | Next | Previous | View Threaded


jorge at dti2

May 7, 2012, 10:52 AM

Post #1 of 5 (275 views)
Permalink
[RFC PATCH 00/25] Mostly bgpd optimizations

From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>

This patchset is part of my work in the last weeks to optimize the speed
and memory usage of the bgpd daemon.

My test case has been a full internet table loading on a pIII class
machine. With the patches just the table loading time went from 14 to 10
seconds. And memory usage it is a lot more stable, due to less heap
fragmentation.

Please, take a look at it, comments welcome.

Jorge Boncompte [DTI2] (25):
bgpd: optimize aspath string representation and assegments handling
bgpd: optimize bgp_nexthop_self()
bgpd: debug buffers cleanup and optimization
bgpd: remove calls to peer_sort() from fast-path
bgpd: optimize loops on [e]community_hash_make()
bgpd: optimize bgp_info_cmp()
bgpd: remove some useless initializations
bgpd: reduce attrhash_make_key() indirections
bgpd: use on stack struct attr_extra on bgp_attr_aggregate_intern()
bgpd: cleanup bgp_attr_unintern()
bgpd: use on stack struct attr_extra in bgp_attr_unintern()
bgpd: fix struct attr_extra leak in bgp_default_originate()
bgpd: use on stack struct attr_extra in bgp_update_receive()
bgpd: bgp_attr_default_set() already allocates a struct attr_extra
bgpd: reduce struct attr_extra allocations/freeing
bgpd: Remove useless initialization
bgpd: optimize holdtime timer cancelling
bgpd: optimize bgp_update_main() in the soft_reconfig case
bgpd: fix for bgp_node_lookup()
bgpd: optimize bgp_aggregate_[increment|decrement]()
micro-op bgp_node_[get|lookup]() and route_node_[get|lookup]()
lib: remove RUSAGE_T from struct thread
lib: micro-op for thread_get()
lib: do not allocate/free thread funcnames
lib: optimize IPV4_ADDR_[SAME|COPY]()

bgpd/bgp_aspath.c | 141 ++++++++++---------
bgpd/bgp_aspath.h | 1 +
bgpd/bgp_attr.c | 121 +++++++++--------
bgpd/bgp_community.c | 19 ++-
bgpd/bgp_ecommunity.c | 21 ++-
bgpd/bgp_mpath.c | 2 +-
bgpd/bgp_network.c | 4 +-
bgpd/bgp_nexthop.c | 108 +++++++++++++---
bgpd/bgp_nexthop.h | 3 +-
bgpd/bgp_packet.c | 87 +++++++-----
bgpd/bgp_route.c | 357 +++++++++++++++++++++++++------------------------
bgpd/bgp_table.c | 20 ++-
bgpd/bgp_vty.c | 4 +-
bgpd/bgp_zebra.c | 8 +-
bgpd/bgpd.c | 57 +++++----
bgpd/bgpd.h | 24 ++--
lib/memtypes.c | 2 +-
lib/prefix.c | 2 +-
lib/prefix.h | 4 +-
lib/table.c | 18 ++-
lib/thread.c | 51 +++-----
lib/thread.h | 8 +-
ospfd/ospf_packet.c | 2 +-
23 files changed, 594 insertions(+), 470 deletions(-)

--
1.7.8.3


_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev


paul at jakma

May 8, 2012, 8:44 AM

Post #2 of 5 (263 views)
Permalink
Re: [RFC PATCH 00/25] Mostly bgpd optimizations [In reply to]

Hi,

Do you have any idea which of the patches contribute what amount of
savings? Did you take profiles from before and after, or? Some idea of the
methodology would be useful.

regards,

Paul

On Mon, 7 May 2012, Jorge Boncompte [DTI2] wrote:

> From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>
>
> This patchset is part of my work in the last weeks to optimize the speed
> and memory usage of the bgpd daemon.
>
> My test case has been a full internet table loading on a pIII class
> machine. With the patches just the table loading time went from 14 to 10
> seconds. And memory usage it is a lot more stable, due to less heap
> fragmentation.
>
> Please, take a look at it, comments welcome.
>
> Jorge Boncompte [DTI2] (25):
> bgpd: optimize aspath string representation and assegments handling
> bgpd: optimize bgp_nexthop_self()
> bgpd: debug buffers cleanup and optimization
> bgpd: remove calls to peer_sort() from fast-path
> bgpd: optimize loops on [e]community_hash_make()
> bgpd: optimize bgp_info_cmp()
> bgpd: remove some useless initializations
> bgpd: reduce attrhash_make_key() indirections
> bgpd: use on stack struct attr_extra on bgp_attr_aggregate_intern()
> bgpd: cleanup bgp_attr_unintern()
> bgpd: use on stack struct attr_extra in bgp_attr_unintern()
> bgpd: fix struct attr_extra leak in bgp_default_originate()
> bgpd: use on stack struct attr_extra in bgp_update_receive()
> bgpd: bgp_attr_default_set() already allocates a struct attr_extra
> bgpd: reduce struct attr_extra allocations/freeing
> bgpd: Remove useless initialization
> bgpd: optimize holdtime timer cancelling
> bgpd: optimize bgp_update_main() in the soft_reconfig case
> bgpd: fix for bgp_node_lookup()
> bgpd: optimize bgp_aggregate_[increment|decrement]()
> micro-op bgp_node_[get|lookup]() and route_node_[get|lookup]()
> lib: remove RUSAGE_T from struct thread
> lib: micro-op for thread_get()
> lib: do not allocate/free thread funcnames
> lib: optimize IPV4_ADDR_[SAME|COPY]()
>
> bgpd/bgp_aspath.c | 141 ++++++++++---------
> bgpd/bgp_aspath.h | 1 +
> bgpd/bgp_attr.c | 121 +++++++++--------
> bgpd/bgp_community.c | 19 ++-
> bgpd/bgp_ecommunity.c | 21 ++-
> bgpd/bgp_mpath.c | 2 +-
> bgpd/bgp_network.c | 4 +-
> bgpd/bgp_nexthop.c | 108 +++++++++++++---
> bgpd/bgp_nexthop.h | 3 +-
> bgpd/bgp_packet.c | 87 +++++++-----
> bgpd/bgp_route.c | 357 +++++++++++++++++++++++++------------------------
> bgpd/bgp_table.c | 20 ++-
> bgpd/bgp_vty.c | 4 +-
> bgpd/bgp_zebra.c | 8 +-
> bgpd/bgpd.c | 57 +++++----
> bgpd/bgpd.h | 24 ++--
> lib/memtypes.c | 2 +-
> lib/prefix.c | 2 +-
> lib/prefix.h | 4 +-
> lib/table.c | 18 ++-
> lib/thread.c | 51 +++-----
> lib/thread.h | 8 +-
> ospfd/ospf_packet.c | 2 +-
> 23 files changed, 594 insertions(+), 470 deletions(-)
>
>

--
Paul Jakma paul [at] jakma @pjakma Key ID: 64A2FF6A
Fortune:
Oliver's Law:
Experience is something you don't get until just after you need it.
_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev


jorge at dti2

May 8, 2012, 10:17 AM

Post #3 of 5 (262 views)
Permalink
Re: [RFC PATCH 00/25] Mostly bgpd optimizations [In reply to]

El 08/05/2012 17:44, Paul Jakma escribió:
> Hi,
>
> Do you have any idea which of the patches contribute what amount of savings? Did
> you take profiles from before and after, or? Some idea of the methodology would
> be useful.
>

I have not profiled all the patches. But the first six are related to functions
scoring high on the profiling. malloc() of course it is another offender, and
all this work started because I wanted to get rid as much as possible of the
memory fragmentation.

> regards,
>
> Paul
>
> On Mon, 7 May 2012, Jorge Boncompte [DTI2] wrote:
>
>> From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>
>>
>> This patchset is part of my work in the last weeks to optimize the speed
>> and memory usage of the bgpd daemon.
>>
>> My test case has been a full internet table loading on a pIII class
>> machine. With the patches just the table loading time went from 14 to 10
>> seconds. And memory usage it is a lot more stable, due to less heap
>> fragmentation.
>>
>> Please, take a look at it, comments welcome.
>>
>> Jorge Boncompte [DTI2] (25):
>> bgpd: optimize aspath string representation and assegments handling
>> bgpd: optimize bgp_nexthop_self()
>> bgpd: debug buffers cleanup and optimization
>> bgpd: remove calls to peer_sort() from fast-path
>> bgpd: optimize loops on [e]community_hash_make()
>> bgpd: optimize bgp_info_cmp()
>> bgpd: remove some useless initializations
>> bgpd: reduce attrhash_make_key() indirections
>> bgpd: use on stack struct attr_extra on bgp_attr_aggregate_intern()
>> bgpd: cleanup bgp_attr_unintern()
>> bgpd: use on stack struct attr_extra in bgp_attr_unintern()
>> bgpd: fix struct attr_extra leak in bgp_default_originate()
>> bgpd: use on stack struct attr_extra in bgp_update_receive()
>> bgpd: bgp_attr_default_set() already allocates a struct attr_extra
>> bgpd: reduce struct attr_extra allocations/freeing
>> bgpd: Remove useless initialization
>> bgpd: optimize holdtime timer cancelling
>> bgpd: optimize bgp_update_main() in the soft_reconfig case
>> bgpd: fix for bgp_node_lookup()
>> bgpd: optimize bgp_aggregate_[increment|decrement]()
>> micro-op bgp_node_[get|lookup]() and route_node_[get|lookup]()
>> lib: remove RUSAGE_T from struct thread
>> lib: micro-op for thread_get()
>> lib: do not allocate/free thread funcnames
>> lib: optimize IPV4_ADDR_[SAME|COPY]()
>>
>> bgpd/bgp_aspath.c | 141 ++++++++++---------
>> bgpd/bgp_aspath.h | 1 +
>> bgpd/bgp_attr.c | 121 +++++++++--------
>> bgpd/bgp_community.c | 19 ++-
>> bgpd/bgp_ecommunity.c | 21 ++-
>> bgpd/bgp_mpath.c | 2 +-
>> bgpd/bgp_network.c | 4 +-
>> bgpd/bgp_nexthop.c | 108 +++++++++++++---
>> bgpd/bgp_nexthop.h | 3 +-
>> bgpd/bgp_packet.c | 87 +++++++-----
>> bgpd/bgp_route.c | 357 +++++++++++++++++++++++++------------------------
>> bgpd/bgp_table.c | 20 ++-
>> bgpd/bgp_vty.c | 4 +-
>> bgpd/bgp_zebra.c | 8 +-
>> bgpd/bgpd.c | 57 +++++----
>> bgpd/bgpd.h | 24 ++--
>> lib/memtypes.c | 2 +-
>> lib/prefix.c | 2 +-
>> lib/prefix.h | 4 +-
>> lib/table.c | 18 ++-
>> lib/thread.c | 51 +++-----
>> lib/thread.h | 8 +-
>> ospfd/ospf_packet.c | 2 +-
>> 23 files changed, 594 insertions(+), 470 deletions(-)
>>
>>
>


_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev


equinox at opensourcerouting

May 21, 2012, 7:30 AM

Post #4 of 5 (227 views)
Permalink
Re: [RFC PATCH 00/25] Mostly bgpd optimizations [In reply to]

On Mon, May 07, 2012 at 07:52:50PM +0200, Jorge Boncompte [DTI2] wrote:
> From: "Jorge Boncompte [DTI2]" <jorge [at] dti2>
>
> This patchset is part of my work in the last weeks to optimize the speed
> and memory usage of the bgpd daemon.
>
> My test case has been a full internet table loading on a pIII class
> machine. With the patches just the table loading time went from 14 to 10
> seconds. And memory usage it is a lot more stable, due to less heap
> fragmentation.
>
> Please, take a look at it, comments welcome.

removed 14 & 19, looking through it right now, expecting to push onto
master in a few hours. [branch on git: volatile/jp_bgp_120507]

Btw, feel free to create a public git tree & send git pull requests :)

-David
Attachments: signature.asc (0.22 KB)


equinox at diac24

May 22, 2012, 3:34 PM

Post #5 of 5 (216 views)
Permalink
Re: [RFC PATCH 00/25] Mostly bgpd optimizations [In reply to]

On Mon, May 07, 2012 at 07:52:50PM +0200, Jorge Boncompte [DTI2] wrote:
> This patchset is part of my work in the last weeks to optimize the speed
> and memory usage of the bgpd daemon.
[...]

Merged 22 of 25, Thanks!

Not merged werre:

> bgpd: bgp_attr_default_set() already allocates a struct attr_extra
> bgpd: fix for bgp_node_lookup()
> lib: optimize IPV4_ADDR_[SAME|COPY]()

-David
Attachments: signature.asc (0.22 KB)

Quagga dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.