• KOSAKI Motohiro's avatar
    mm: size of quicklists shouldn't be proportional to the number of CPUs · b9541852
    KOSAKI Motohiro authored
    Quicklists store pages for each CPU as caches.  (Each CPU can cache
    node_free_pages/16 pages)
    
    It is used for page table cache.  exit() will increase the cache size,
    while fork() consumes it.
    
    So for example if an apache-style application runs (one parent and many
    child model), one CPU process will fork() while another CPU will process
    the middleware work and exit().
    
    At that time, the CPU on which the parent runs doesn't have page table
    cache at all.  Others (on which children runs) have maximum caches.
    
    	QList_max = (#ofCPUs - 1) x Free / 16
    	=> QList_max / (Free + QList_max) = (#ofCPUs - 1) / (16 + #ofCPUs - 1)
    
    So, How much quicklist memory is used in the maximum case?
    
    This is proposional to # of CPUs because the limit of per cpu quicklist
    cache doesn't see the number of cpus.
    
    Above calculation mean
    
    	 Number of CPUs per node            2    4    8   16
    	 ==============================  ====================
    	 QList_max / (Free + ...
    b9541852
quicklist.c 2.44 KB