• Linus Torvalds's avatar
    mm: get rid of 'vmalloc_info' from /proc/meminfo · a5ad88ce
    Linus Torvalds authored
    It turns out that at least some versions of glibc end up reading
    /proc/meminfo at every single startup, because glibc wants to know the
    amount of memory the machine has.  And while that's arguably insane,
    it's just how things are.
    
    And it turns out that it's not all that expensive most of the time, but
    the vmalloc information statistics (amount of virtual memory used in the
    vmalloc space, and the biggest remaining chunk) can be rather expensive
    to compute.
    
    The 'get_vmalloc_info()' function actually showed up on my profiles as
    4% of the CPU usage of "make test" in the git source repository, because
    the git tests are lots of very short-lived shell-scripts etc.
    
    It turns out that apparently this same silly vmalloc info gathering
    shows up on the facebook servers too, according to Dave Jones.  So it's
    not just "make test" for git.
    
    We had two patches to just cache the information (one by me, one by
    Ingo) to mitigate this issue, but the whole vmalloc information...
    a5ad88ce
meminfo.c 5.86 KB