Skip to content
  • Peter Lieven's avatar
    101420b8
    exec: avoid realloc in phys_map_node_reserve · 101420b8
    Peter Lieven authored
    
    
    this is the first step in reducing the brk heap fragmentation
    created by the map->nodes memory allocation. Since the introduction
    of RCU the freeing of the PhysPageMaps is delayed so that sometimes
    several hundred are allocated at the same time.
    
    Even worse the memory for map->nodes is allocated and shortly
    afterwards reallocated. Since the number of nodes it grows
    to in the end is the same for all PhysPageMaps remember this value
    and at least avoid the reallocation.
    
    The large number of simultaneous allocations (about 450 x 70kB in
    my configuration) has to be addressed later.
    
    Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
    Message-Id: <1468577030-21097-1-git-send-email-pl@kamp.de>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    101420b8
    exec: avoid realloc in phys_map_node_reserve
    Peter Lieven authored
    
    
    this is the first step in reducing the brk heap fragmentation
    created by the map->nodes memory allocation. Since the introduction
    of RCU the freeing of the PhysPageMaps is delayed so that sometimes
    several hundred are allocated at the same time.
    
    Even worse the memory for map->nodes is allocated and shortly
    afterwards reallocated. Since the number of nodes it grows
    to in the end is the same for all PhysPageMaps remember this value
    and at least avoid the reallocation.
    
    The large number of simultaneous allocations (about 450 x 70kB in
    my configuration) has to be addressed later.
    
    Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
    Message-Id: <1468577030-21097-1-git-send-email-pl@kamp.de>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading