We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82f0b6f commit a34acf3Copy full SHA for a34acf3
mm/vmalloc.c
@@ -2543,7 +2543,15 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
2543
static struct xarray *
2544
addr_to_vb_xa(unsigned long addr)
2545
{
2546
- int index = (addr / VMAP_BLOCK_SIZE) % num_possible_cpus();
+ int index = (addr / VMAP_BLOCK_SIZE) % nr_cpu_ids;
2547
+
2548
+ /*
2549
+ * Please note, nr_cpu_ids points on a highest set
2550
+ * possible bit, i.e. we never invoke cpumask_next()
2551
+ * if an index points on it which is nr_cpu_ids - 1.
2552
+ */
2553
+ if (!cpu_possible(index))
2554
+ index = cpumask_next(index, cpu_possible_mask);
2555
2556
return &per_cpu(vmap_block_queue, index).vmap_blocks;
2557
}
0 commit comments