lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <87r2hhgeqe.fsf@linux.ibm.com>
Date:   Wed, 26 Sep 2018 08:13:53 +0530
From:   "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
To:     Christophe Leroy <christophe.leroy@....fr>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        aneesh.kumar@...ux.vnet.ibm.com
Cc:     linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v5 15/22] powerpc/mm: Avoid useless lock with single page fragments

Christophe Leroy <christophe.leroy@....fr> writes:

> There is no point in taking the page table lock as pte_frag or
> pmd_frag are always NULL when we have only one fragment.
>

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@...ux.ibm.com>

> Signed-off-by: Christophe Leroy <christophe.leroy@....fr>
> ---
>  arch/powerpc/mm/pgtable-book3s64.c | 3 +++
>  arch/powerpc/mm/pgtable-frag.c     | 3 +++
>  2 files changed, 6 insertions(+)
>
> diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c
> index 723cd324fa34..c43e225e124d 100644
> --- a/arch/powerpc/mm/pgtable-book3s64.c
> +++ b/arch/powerpc/mm/pgtable-book3s64.c
> @@ -239,6 +239,9 @@ static pmd_t *get_pmd_from_cache(struct mm_struct *mm)
>  {
>  	void *pmd_frag, *ret;
>  
> +	if (PMD_FRAG_NR == 1)
> +		return NULL;
> +
>  	spin_lock(&mm->page_table_lock);
>  	ret = mm->context.pmd_frag;
>  	if (ret) {
> diff --git a/arch/powerpc/mm/pgtable-frag.c b/arch/powerpc/mm/pgtable-frag.c
> index d61e7c2a9a79..7544d0d7177d 100644
> --- a/arch/powerpc/mm/pgtable-frag.c
> +++ b/arch/powerpc/mm/pgtable-frag.c
> @@ -34,6 +34,9 @@ static pte_t *get_pte_from_cache(struct mm_struct *mm)
>  {
>  	void *pte_frag, *ret;
>  
> +	if (PTE_FRAG_NR == 1)
> +		return NULL;
> +
>  	spin_lock(&mm->page_table_lock);
>  	ret = mm->context.pte_frag;
>  	if (ret) {
> -- 
> 2.13.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ