[PATCH V14 1/6] mm: softdirty: Add pgtable_supports_soft_dirty()

David Hildenbrand david at redhat.com
Thu Sep 18 02:03:02 PDT 2025


On 18.09.25 10:37, Chunyan Zhang wrote:
> Some platforms can customize the PTE PMD entry soft-dirty bit making it
> unavailable even if the architecture provides the resource.
> 
> Add an API which architectures can define their specific implementations
> to detect if soft-dirty bit is available on which device the kernel is
> running.
> 
> This patch is removing "ifdef CONFIG_MEM_SOFT_DIRTY" in favor of
> pgtable_supports_soft_dirty() checks that defaults to
> IS_ENABLED(CONFIG_MEM_SOFT_DIRTY), if not overridden by
> the architecture, no change in behavior is expected.
> 
> We make sure to never set VM_SOFTDIRTY if !pgtable_supports_soft_dirty(),
> so we will never run into VM_SOFTDIRTY checks.
> 
> Acked-by: David Hildenbrand <david at redhat.com>
> Signed-off-by: Chunyan Zhang <zhangchunyan at iscas.ac.cn>
> ---

[...]

>   mas_store_fail:
> diff --git a/mm/vma_exec.c b/mm/vma_exec.c
> index 922ee51747a6..a822fb73f4e2 100644
> --- a/mm/vma_exec.c
> +++ b/mm/vma_exec.c
> @@ -107,6 +107,7 @@ int relocate_vma_down(struct vm_area_struct *vma, unsigned long shift)
>   int create_init_stack_vma(struct mm_struct *mm, struct vm_area_struct **vmap,
>   			  unsigned long *top_mem_p)
>   {
> +	unsigned long flags  = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP;

No need to resend because of this (probably can be fixed up when 
applying): there is a double space before the "="

-- 
Cheers

David / dhildenb




More information about the linux-riscv mailing list