[PATCH 1/3] riscv: mm: Rename new_vmalloc into new_valid_map_cpus

Vivian Wang wangruikang at iscas.ac.cn
Mon Mar 2 18:11:24 PST 2026


On 3/2/26 23:41, Alexander Potapenko wrote:
> On Mon, Mar 2, 2026 at 3:21 AM Vivian Wang <wangruikang at iscas.ac.cn> wrote:
>> In preparation of a future patch using this mechanism for non-vmalloc
>> mappings, rename new_vmalloc into new_valid_map_cpus to avoid misleading
>> readers.
>>
>> No functional change intended.
>>
>> Signed-off-by: Vivian Wang <wangruikang at iscas.ac.cn>
>> ---
>>  arch/riscv/include/asm/cacheflush.h |  6 +++---
>>  arch/riscv/kernel/entry.S           | 38 ++++++++++++++++++-------------------
>>  arch/riscv/mm/init.c                |  2 +-
>>  3 files changed, 23 insertions(+), 23 deletions(-)
>>
>> diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/asm/cacheflush.h
>> index 0092513c3376..b6d1a5eb7564 100644
>> --- a/arch/riscv/include/asm/cacheflush.h
>> +++ b/arch/riscv/include/asm/cacheflush.h
>> @@ -41,7 +41,7 @@ do {                                                  \
>>  } while (0)
>>
>>  #ifdef CONFIG_64BIT
>> -extern u64 new_vmalloc[NR_CPUS / sizeof(u64) + 1];
>> +extern u64 new_valid_map_cpus[NR_CPUS / sizeof(u64) + 1];
> new_valid_map_cpus is a bitmap, right? If so, you are allocating 8x
> more memory than needed.
> Can we use DECLARE_BITMAP instead?

I hadn't considered changing since this series is supposed to be just a
fix, but that is a good point.

I'll reorganize this in v2 to include a fix to use DECLARE_BITMAP, and
also use bitmap operations for the marking operation. But I'll leave
that out of consideration for stable backport, maybe along with the
renaming.

Thanks,
Vivian "dramforever" Wang




More information about the linux-riscv mailing list