/* memory_less_node_alloc - * attempt to allocate memory on the best NUMA slit node but fall back to any other node when __alloc_bootmem_node fails for best. @nid: node id @pernodesize: size of this node's pernode data  */
static void __init* memory_less_node_alloc(int nid, unsigned long pernodesize)
/* memory_less_node_alloc - * attempt to allocate memory on the best NUMA slit node but fall back to any other node when __alloc_bootmem_node fails for best. @nid: node id @pernodesize: size of this node's pernode data  */
static void __init* memory_less_node_alloc(int nid, unsigned long pernodesize)
{
	void *ptr = NULL;
	u8 best = 0xff;
	int bestnode = -1, node, anynode = 0;
	for_each_online_node(node) {
		if (node_isset(node, memory_less_mask))
			continue;
		else if (node_distance(nid, node) < best) {
			best = node_distance(nid, node);
			bestnode = node;
		}
		anynode = node;
	}
	if (bestnode == -1)
		bestnode = anynode;
	ptr = __alloc_bootmem_node(pgdat_list[bestnode], pernodesize,
		PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
	return ptr;
}