diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2024-07-06 20:44:41 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-07-06 20:44:41 +0200 |
commit | 8ef6fd0e9ea83a792ba53882ddc6e0d38ce0d636 (patch) | |
tree | b119eaeb76c7afb8672d30078ab7061cb7be67fb /mm/vmalloc.c | |
parent | docs: mm: add enable_soft_offline sysctl (diff) | |
parent | MAINTAINERS: mailmap: update Lorenzo Stoakes's email address (diff) | |
download | linux-8ef6fd0e9ea83a792ba53882ddc6e0d38ce0d636.tar.xz linux-8ef6fd0e9ea83a792ba53882ddc6e0d38ce0d636.zip |
Merge branch 'mm-hotfixes-stable' into mm-stable to pick up "mm: fix
crashes from deferred split racing folio migration", needed by "mm:
migrate: split folio_migrate_mapping()".
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index b4c42da9f390..6b783baf12a1 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2544,7 +2544,15 @@ static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue); static struct xarray * addr_to_vb_xa(unsigned long addr) { - int index = (addr / VMAP_BLOCK_SIZE) % num_possible_cpus(); + int index = (addr / VMAP_BLOCK_SIZE) % nr_cpu_ids; + + /* + * Please note, nr_cpu_ids points on a highest set + * possible bit, i.e. we never invoke cpumask_next() + * if an index points on it which is nr_cpu_ids - 1. + */ + if (!cpu_possible(index)) + index = cpumask_next(index, cpu_possible_mask); return &per_cpu(vmap_block_queue, index).vmap_blocks; } |