Skip to content
Snippets Groups Projects
  1. May 15, 2014
  2. May 14, 2014
  3. May 13, 2014
    • Glauber Costa's avatar
      netchannels: specialize new and delete operators · 8e087635
      Glauber Costa authored
      
      While running one of the redis benchmarks, I saw around 23k calls to
      malloc_large.  Among those, ~10 - 11k were 2-page sized. I managed to track it
      down to the creation of net channels. The problem here is that the net channel
      structure is slightly larger than half a page - the maximum size for small
      object pools. That will throw all allocations into malloc_large. Besides being
      slow, it also wastes a page for every net channel created, since malloc_large
      will include an extra page in the beginning of each allocation.
      
      This patch fixes this by overloading the operators new and delete for the
      netchannel structure so that we use the more efficient and less wasteful
      alloc_page.
      
      Reviewed-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      8e087635
  4. May 12, 2014
Loading