|
@@ -400,9 +400,17 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt)
|
|
|
n = simple_strtoul(emu_cmdline, &emu_cmdline, 0);
|
|
|
ret = -1;
|
|
|
for_each_node_mask(i, physnode_mask) {
|
|
|
+ /*
|
|
|
+ * The reason we pass in blk[0] is due to
|
|
|
+ * numa_remove_memblk_from() called by
|
|
|
+ * emu_setup_memblk() will delete entry 0
|
|
|
+ * and then move everything else up in the pi.blk
|
|
|
+ * array. Therefore we should always be looking
|
|
|
+ * at blk[0].
|
|
|
+ */
|
|
|
ret = split_nodes_size_interleave_uniform(&ei, &pi,
|
|
|
- pi.blk[i].start, pi.blk[i].end, 0,
|
|
|
- n, &pi.blk[i], nid);
|
|
|
+ pi.blk[0].start, pi.blk[0].end, 0,
|
|
|
+ n, &pi.blk[0], nid);
|
|
|
if (ret < 0)
|
|
|
break;
|
|
|
if (ret < n) {
|