• I
    x86, mm: Allow highmem user page tables to be disabled at boot time · 14315592
    Ian Campbell 提交于
    Distros generally (I looked at Debian, RHEL5 and SLES11) seem to
    enable CONFIG_HIGHPTE for any x86 configuration which has highmem
    enabled. This means that the overhead applies even to machines which
    have a fairly modest amount of high memory and which therefore do not
    really benefit from allocating PTEs in high memory but still pay the
    price of the additional mapping operations.
    
    Running kernbench on a 4G box I found that with CONFIG_HIGHPTE=y but
    no actual highptes being allocated there was a reduction in system
    time used from 59.737s to 55.9s.
    
    With CONFIG_HIGHPTE=y and highmem PTEs being allocated:
      Average Optimal load -j 4 Run (std deviation):
      Elapsed Time 175.396 (0.238914)
      User Time 515.983 (5.85019)
      System Time 59.737 (1.26727)
      Percent CPU 263.8 (71.6796)
      Context Switches 39989.7 (4672.64)
      Sleeps 42617.7 (246.307)
    
    With CONFIG_HIGHPTE=y but with no highmem PTEs being allocated:
      Average Optimal load -j 4 Run (std deviation):
      Elapsed Time 174.278 (0.831968)
      User Time 515.659 (6.07012)
      System Time 55.9 (1.07799)
      Percent CPU 263.8 (71.266)
      Context Switches 39929.6 (4485.13)
      Sleeps 42583.7 (373.039)
    
    This patch allows the user to control the allocation of PTEs in
    highmem from the command line ("userpte=nohigh") but retains the
    status-quo as the default.
    
    It is possible that some simple heuristic could be developed which
    allows auto-tuning of this option however I don't have a sufficiently
    large machine available to me to perform any particularly meaningful
    experiments. We could probably handwave up an argument for a threshold
    at 16G of total RAM.
    
    Assuming 768M of lowmem we have 196608 potential lowmem PTE
    pages. Each page can map 2M of RAM in a PAE-enabled configuration,
    meaning a maximum of 384G of RAM could potentially be mapped using
    lowmem PTEs.
    
    Even allowing generous factor of 10 to account for other required
    lowmem allocations, generous slop to account for page sharing (which
    reduces the total amount of RAM mappable by a given number of PT
    pages) and other innacuracies in the estimations it would seem that
    even a 32G machine would not have a particularly pressing need for
    highmem PTEs. I think 32G could be considered to be at the upper bound
    of what might be sensible on a 32 bit machine (although I think in
    practice 64G is still supported).
    
    It's seems questionable if HIGHPTE is even a win for any amount of RAM
    you would sensibly run a 32 bit kernel on rather than going 64 bit.
    Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
    LKML-Reference: <1266403090-20162-1-git-send-email-ian.campbell@citrix.com>
    Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
    14315592
pgalloc.h 4.0 KB