Re: [PATCH] mm: avoid zeroing user movable page twice with init_on_alloc=1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/4/24 16:24, Zi Yan wrote:
> On 4 Dec 2024, at 5:41, Geert Uytterhoeven wrote:
> 
> The provided config does not have THP on, so the changes to mm/huge_memory.c
> and mm/memory.c do not apply.
> 
> Can you try the patch below and see if the machine boots? Thanks.

Hmm looks like mips has some involved clear_user_page()
in arch/mips/include/asm/page.h

So maybe the clearing done as part of page allocator isn't enough here.

> 
> diff --git a/include/linux/highmem.h b/include/linux/highmem.h
> index 6e452bd8e7e3..bec9bd715acf 100644
> --- a/include/linux/highmem.h
> +++ b/include/linux/highmem.h
> @@ -224,7 +224,13 @@ static inline
>  struct folio *vma_alloc_zeroed_movable_folio(struct vm_area_struct *vma,
>  				   unsigned long vaddr)
>  {
> -	return vma_alloc_folio(GFP_HIGHUSER_MOVABLE | __GFP_ZERO, 0, vma, vaddr);
> +	struct folio *folio;
> +
> +	folio = vma_alloc_folio(GFP_HIGHUSER_MOVABLE, 0, vma, vaddr);
> +	if (folio)
> +		clear_user_highpage(&folio->page, vaddr);
> +
> +	return folio;
>  }
>  #endif
> 
> 
> Best Regards,
> Yan, Zi
> 





[Index of Archives]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux