Lines Matching +full:non +full:- +full:interleaved
1 // SPDX-License-Identifier: GPL-2.0
13 #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
28 for (i = 0; i < mi->nr_blks; i++) in emu_find_memblk_by_nid()
29 if (mi->blk[i].nid == nid) in emu_find_memblk_by_nid()
31 return -ENOENT; in emu_find_memblk_by_nid()
45 * Sets up nid to range from @start to @end. The return value is -errno if
52 struct numa_memblk *eb = &ei->blk[ei->nr_blks]; in emu_setup_memblk()
53 struct numa_memblk *pb = &pi->blk[phys_blk]; in emu_setup_memblk()
55 if (ei->nr_blks >= NR_NODE_MEMBLKS) { in emu_setup_memblk()
57 return -EINVAL; in emu_setup_memblk()
60 ei->nr_blks++; in emu_setup_memblk()
61 eb->start = pb->start; in emu_setup_memblk()
62 eb->end = pb->start + size; in emu_setup_memblk()
63 eb->nid = nid; in emu_setup_memblk()
66 emu_nid_to_phys[nid] = pb->nid; in emu_setup_memblk()
68 pb->start += size; in emu_setup_memblk()
69 if (pb->start >= pb->end) { in emu_setup_memblk()
70 WARN_ON_ONCE(pb->start > pb->end); in emu_setup_memblk()
74 printk(KERN_INFO "Faking node %d at [mem %#018Lx-%#018Lx] (%LuMB)\n", in emu_setup_memblk()
75 nid, eb->start, eb->end - 1, (eb->end - eb->start) >> 20); in emu_setup_memblk()
80 * Sets up nr_nodes fake nodes interleaved over physical nodes ranging from addr
96 return -1; in split_nodes_interleave()
107 size = max_addr - addr - mem_hole_size(addr, max_addr); in split_nodes_interleave()
121 return -1; in split_nodes_interleave()
139 start = pi->blk[phys_blk].start; in split_nodes_interleave()
140 limit = pi->blk[phys_blk].end; in split_nodes_interleave()
148 * non-reserved memory is less than the per-node size. in split_nodes_interleave()
150 while (end - start - mem_hole_size(start, end) < size) { in split_nodes_interleave()
160 * non-reserved memory in ZONE_DMA32 for the next node, in split_nodes_interleave()
163 if (end < dma32_end && dma32_end - end - in split_nodes_interleave()
168 * If there won't be enough non-reserved memory for the in split_nodes_interleave()
172 if (limit - end - mem_hole_size(end, limit) < size) in split_nodes_interleave()
177 min(end, limit) - start); in split_nodes_interleave()
187 * non-reserved memory or `max_addr' is reached.
193 while (end - start - mem_hole_size(start, end) < size) { in find_end_of_node()
209 return PFN_PHYS((max_pfn - base_pfn - hole_pfns) / nr_nodes); in uniform_size()
213 * Sets up fake nodes of `size' interleaved over physical nodes ranging from
229 return -1; in split_nodes_size_interleave_uniform()
233 * nr_nodes, in the non-uniform case, ignore the passed in in split_nodes_size_interleave_uniform()
238 * capacity, i.e. ignore holes. In the non-uniform case account in split_nodes_size_interleave_uniform()
245 node_set(pblk->nid, physnode_mask); in split_nodes_size_interleave_uniform()
287 start = pi->blk[phys_blk].start; in split_nodes_size_interleave_uniform()
288 limit = pi->blk[phys_blk].end; in split_nodes_size_interleave_uniform()
296 * non-reserved memory in ZONE_DMA32 for the next node, in split_nodes_size_interleave_uniform()
299 if (end < dma32_end && dma32_end - end - in split_nodes_size_interleave_uniform()
304 * If there won't be enough non-reserved memory for the in split_nodes_size_interleave_uniform()
308 if ((limit - end - mem_hole_size(end, limit) < size) in split_nodes_size_interleave_uniform()
314 min(end, limit) - start); in split_nodes_size_interleave_uniform()
347 * numa_emulation - Emulate NUMA nodes
358 * - @numa_meminfo is updated to reflect the emulated nodes.
360 * - __apicid_to_node[] is updated such that APIC IDs are mapped to the
363 * - NUMA distance table is rebuilt to represent distances between emulated
367 * - emu_nid_to_phys[] reflects how emulated nodes are mapped to physical
393 * If the numa=fake command-line contains a 'M' or 'G', it represents in numa_emulation()
403 ret = -1; in numa_emulation()
421 ret = -1; in numa_emulation()