[PATCH v4 06/12] mm: introduce generic lazy_mmu helpers
David Hildenbrand (Red Hat)
davidhildenbrandkernel at gmail.com
Sat Nov 8 01:34:03 AEDT 2025
>> #ifndef pte_batch_hint
>> diff --git a/mm/kasan/shadow.c b/mm/kasan/shadow.c
>> index 5d2a876035d6..c49b029d3593 100644
>> --- a/mm/kasan/shadow.c
>> +++ b/mm/kasan/shadow.c
>> @@ -305,7 +305,7 @@ static int kasan_populate_vmalloc_pte(pte_t *ptep, unsigned long addr,
>> pte_t pte;
>> int index;
>>
>> - arch_leave_lazy_mmu_mode();
>> + lazy_mmu_mode_pause();
>
> I wonder if there really are use cases that *require* pause/resume? I think
> these kasan cases could be correctly implemented using a new nest level instead?
> Are there cases where the effects really need to be immediate or do the effects
> just need to be visible when you get to where the resume is?
>
> If the latter, that could just be turned into a nested disable (e.g. a flush).
> In this case, there is only 1 PTE write so no benefit, but I wonder if other
> cases may have more PTE writes that could then still be batched. It would be
> nice to simplify the API by removing pause/resume if we can?
It has clear semantics, clearer than some nest-disable IMHO.
Maybe you can elaborate how you would change ("simplify") the API in
that regard? What would the API look like?
More information about the Linuxppc-dev
mailing list