• Andrew Morton's avatar
    [PATCH] Limit hashtable sizes · 7453596a
    Andrew Morton authored
    From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
    
    The issue of exceedingly large hash tables has been discussed on the
    mailing list a while back, but seems to slip through the cracks.
    
    What we found is it's not a problem for x86 (and most other
    architectures) because __get_free_pages won't be able to get anything
    beyond order MAX_ORDER-1 (10) which means at most those hash tables are
    4MB each (assume 4K page size).  However, on ia64, in order to support
    larger hugeTLB page size, the MAX_ORDER is bumped up to 18, which now
    means a 2GB upper limits enforced by the page allocator (assume 16K page
    size).  PPC64 is another example that bumps up MAX_ORDER.
    
    Last time I checked, the tcp ehash table is taking a whooping (insane!)
    2GB on one of our large machine.  dentry and inode hash tables also take
    considerable amount of memory.
    
    Setting the size of these tables is difficult: they need to be constrained on
    many-zone ia64 machines, but this could cause significant performance
    problems when there are (for example) 100 million dentries in cache.
    Large-memory machines which do not slice that memory up into huge numbers of
    zones do not need to run the risk of this slowdown.
    
    So the sizing algorithms remain essentially unchanged, and boot-time options
    are provided which permit the tables to be scaled down.
    7453596a
tcp.c 71 KB