Re: [PATCH 3/8] MIPS: Ensure pmd_present() returns false after pmd_mknotpresent()

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

 



On Thu, Aug 10, 2017 at 10:04:37AM +0800, Huacai Chen wrote:
> This patch is borrowed from ARM64 to ensure pmd_present() returns false

I presume you're referring to commit 5bb1cc0ff9a6 ("arm64: Ensure
pmd_present() returns false after pmd_mknotpresent()"). I think it would
be worth mentioning that specifically.

> after pmd_mknotpresent(). This is needed for THP.
> 
> Cc: stable@xxxxxxxxxxxxxxx

Back to what version? 3.8 when THP was added?

Otherwise it looks reasonable:
Reviewed-by: James Hogan <jhogan@xxxxxxxxxx>

Cheers
James

> Signed-off-by: Huacai Chen <chenhc@xxxxxxxxxx>
> ---
>  arch/mips/include/asm/pgtable-64.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h
> index 67fe6dc..a2252c2 100644
> --- a/arch/mips/include/asm/pgtable-64.h
> +++ b/arch/mips/include/asm/pgtable-64.h
> @@ -271,6 +271,11 @@ static inline int pmd_bad(pmd_t pmd)
>  
>  static inline int pmd_present(pmd_t pmd)
>  {
> +#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
> +	if (unlikely(pmd_val(pmd) & _PAGE_HUGE))
> +		return pmd_val(pmd) & _PAGE_PRESENT;
> +#endif
> +
>  	return pmd_val(pmd) != (unsigned long) invalid_pte_table;
>  }
>  
> -- 
> 2.7.0
> 
> 
> 
> 

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux