Mellanox / libxlio

Other
32 stars 18 forks source link

issue: 3777348 Move socket statistics to a global storage #110

Closed AlexanderGrissik closed 5 months ago

AlexanderGrissik commented 5 months ago

Description

This PR is based on PR 106 (issue: 3777348 Simplifying sockinfo inheritance) This PR starts from commit (issue: 3777348 Moving sock stats outside the socket)

What

Socket statistics consume a big chunk of memory in each socket separately. Even in case statistics are not needed these stats take memory and are accesses and updated. This PR moves statistics to a global vector and sockets ask for stats object. Sockets will receive stats objects up to configured max stats. Other sockets will not have stats. This allows:

  1. Saving memory when less stats are needed then amount of sockets (Like 1M sockets)
  2. Disable stats and save CPU cycles and cache access.
Why ?

Performance optimization

Change type

What kind of change does this PR introduce?

Check list