• Johannes Weiner's avatar
    bootmem: respect goal more likely · 0f3caba2
    Johannes Weiner authored
    The old node-agnostic code tried allocating on all nodes starting from the
    one with the lowest range.  alloc_bootmem_core retried without the goal if
    it could not satisfy it and so the goal was only respected at all when it
    happened to be on the first (lowest page numbers) node (or theoretically
    if allocations failed on all nodes before to the one holding the goal).
    Introduce a non-panicking helper that starts allocating from the node
    holding the goal and falls back only after all thes tries failed, thus
    moving the goal fallback code out of alloc_bootmem_core.
    Make all other allocation functions benefit from this new helper.
    Signed-off-by: default avatarJohannes Weiner <hannes@saeurebad.de>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Yinghai Lu <yhlu.kernel@gmail.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
bootmem.c 17.5 KB