• Alex Williamson's avatar
    [PATCH] collect page_states only from online cpus · d841f01f
    Alex Williamson authored
    I noticed the function __read_page_state() curiously high in a q-tools
    profile of a write to a software raid0 device.  Seems this is because we're
    checking page_states for all possible cpus and we have NR_CPUS possible
    when CONFIG_HOTPLUG_CPU=y.  The default config for ia64 is now NR_CPUS=512,
    so on a little 8-way box, this is a significant waste of time.  The patch
    below updates __read_page_state() and __get_page_state() to only count
    page_state info for online cpus.  To keep the stats consistent, the
    page_alloc notifier is updated to move page_states off of the cpu going
    offline.  On my profile, this dropped __read_page_state() back into the
    noise and boosted block write performance by 5% (as measured by spew -
    http://spew.berlios.de).
    Signed-off-by: default avatarAlex Williamson <alex.williamson@hp.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    d841f01f
page_alloc.c 52.1 KB