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 d386c4e commit af324e7Copy full SHA for af324e7
mm/vmalloc.c
@@ -1984,7 +1984,15 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue);
1984
static struct xarray *
1985
addr_to_vb_xa(unsigned long addr)
1986
{
1987
- int index = (addr / VMAP_BLOCK_SIZE) % num_possible_cpus();
+ int index = (addr / VMAP_BLOCK_SIZE) % nr_cpu_ids;
1988
+
1989
+ /*
1990
+ * Please note, nr_cpu_ids points on a highest set
1991
+ * possible bit, i.e. we never invoke cpumask_next()
1992
+ * if an index points on it which is nr_cpu_ids - 1.
1993
+ */
1994
+ if (!cpu_possible(index))
1995
+ index = cpumask_next(index, cpu_possible_mask);
1996
1997
return &per_cpu(vmap_block_queue, index).vmap_blocks;
1998
}
0 commit comments