From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Balbir Singh <bsingharora@gmail.com>,
benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
akpm@linux-foundation.org,
Mel Gorman <mgorman@techsingularity.net>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3] powerpc/mm: Fix Multi hit ERAT cause by recent THP update
Date: Mon, 15 Feb 2016 16:31:59 +0530 [thread overview]
Message-ID: <87d1ryfd94.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1455512997.16012.24.camel@gmail.com>
Balbir Singh <bsingharora@gmail.com> writes:
>> Now we can't depend for mm_cpumask, a parallel find_linux_pte_hugepte
>> can happen outside that. Now i had a variant for kick_all_cpus_sync that
>> ignored idle cpus. But then that needs more verification.
>>=20
>> http://article.gmane.org/gmane.linux.ports.ppc.embedded/81105
> Can be racy as a CPU moves from non-idle to idle
>
> In
>
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pmd_hugepage_update(vma->vm_mm, address, =
pmdp, ~0UL, 0);
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/*
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* This ensures that generic code th=
at rely on IRQ disabling
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* to prevent a parallel THP split w=
ork as expected.
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*/
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0kick_all_cpus_sync();
>
> pmdp_invalidate()->pmd_hugepage_update() can still run in parallel with=
=C2=A0
> find_linux_pte_or_hugepte() and race.. Am I missing something?
>
Yes. But then we make sure that the pte_t returned by
find_linux_pte_or_hugepte doesn't change to a regular pmd entry by using
that kick. Now callers of find_lnux_pte_or_hugepte will check for
_PAGE_PRESENT. So if it called before
pmd_hugepage_update(_PAGE_PRESENT), we wait for the caller to finish the
usage (via kick()). Or they bail out after finding _PAGE_PRESENT cleared.
-aneesh
WARNING: multiple messages have this Message-ID (diff)
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Balbir Singh <bsingharora@gmail.com>,
benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
akpm@linux-foundation.org,
Mel Gorman <mgorman@techsingularity.net>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3] powerpc/mm: Fix Multi hit ERAT cause by recent THP update
Date: Mon, 15 Feb 2016 16:31:59 +0530 [thread overview]
Message-ID: <87d1ryfd94.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1455512997.16012.24.camel@gmail.com>
Balbir Singh <bsingharora@gmail.com> writes:
>> Now we can't depend for mm_cpumask, a parallel find_linux_pte_hugepte
>> can happen outside that. Now i had a variant for kick_all_cpus_sync that
>> ignored idle cpus. But then that needs more verification.
>>
>> http://article.gmane.org/gmane.linux.ports.ppc.embedded/81105
> Can be racy as a CPU moves from non-idle to idle
>
> In
>
>> + pmd_hugepage_update(vma->vm_mm, address, pmdp, ~0UL, 0);
>> + /*
>> + * This ensures that generic code that rely on IRQ disabling
>> + * to prevent a parallel THP split work as expected.
>> + */
>> + kick_all_cpus_sync();
>
> pmdp_invalidate()->pmd_hugepage_update() can still run in parallel with
> find_linux_pte_or_hugepte() and race.. Am I missing something?
>
Yes. But then we make sure that the pte_t returned by
find_linux_pte_or_hugepte doesn't change to a regular pmd entry by using
that kick. Now callers of find_lnux_pte_or_hugepte will check for
_PAGE_PRESENT. So if it called before
pmd_hugepage_update(_PAGE_PRESENT), we wait for the caller to finish the
usage (via kick()). Or they bail out after finding _PAGE_PRESENT cleared.
-aneesh
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Balbir Singh <bsingharora@gmail.com>,
benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
akpm@linux-foundation.org,
Mel Gorman <mgorman@techsingularity.net>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3] powerpc/mm: Fix Multi hit ERAT cause by recent THP update
Date: Mon, 15 Feb 2016 16:31:59 +0530 [thread overview]
Message-ID: <87d1ryfd94.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <1455512997.16012.24.camel@gmail.com>
Balbir Singh <bsingharora@gmail.com> writes:
>> Now we can't depend for mm_cpumask, a parallel find_linux_pte_hugepte
>> can happen outside that. Now i had a variant for kick_all_cpus_sync that
>> ignored idle cpus. But then that needs more verification.
>>
>> http://article.gmane.org/gmane.linux.ports.ppc.embedded/81105
> Can be racy as a CPU moves from non-idle to idle
>
> In
>
>> + pmd_hugepage_update(vma->vm_mm, address, pmdp, ~0UL, 0);
>> + /*
>> + * This ensures that generic code that rely on IRQ disabling
>> + * to prevent a parallel THP split work as expected.
>> + */
>> + kick_all_cpus_sync();
>
> pmdp_invalidate()->pmd_hugepage_update() can still run in parallel with
> find_linux_pte_or_hugepte() and race.. Am I missing something?
>
Yes. But then we make sure that the pte_t returned by
find_linux_pte_or_hugepte doesn't change to a regular pmd entry by using
that kick. Now callers of find_lnux_pte_or_hugepte will check for
_PAGE_PRESENT. So if it called before
pmd_hugepage_update(_PAGE_PRESENT), we wait for the caller to finish the
usage (via kick()). Or they bail out after finding _PAGE_PRESENT cleared.
-aneesh
next prev parent reply other threads:[~2016-02-15 11:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-09 1:20 [PATCH V3] powerpc/mm: Fix Multi hit ERAT cause by recent THP update Aneesh Kumar K.V
2016-02-09 1:20 ` Aneesh Kumar K.V
2016-02-09 12:16 ` [V3] " Michael Ellerman
2016-02-09 12:16 ` Michael Ellerman
2016-02-14 5:32 ` Aneesh Kumar K.V
2016-02-14 5:32 ` Aneesh Kumar K.V
2016-02-15 2:44 ` [PATCH V3] " Balbir Singh
2016-02-15 2:44 ` Balbir Singh
2016-02-15 4:37 ` Aneesh Kumar K.V
2016-02-15 4:37 ` Aneesh Kumar K.V
2016-02-15 4:37 ` Aneesh Kumar K.V
2016-02-15 5:09 ` Balbir Singh
2016-02-15 5:09 ` Balbir Singh
2016-02-15 11:01 ` Aneesh Kumar K.V [this message]
2016-02-15 11:01 ` Aneesh Kumar K.V
2016-02-15 11:01 ` Aneesh Kumar K.V
2016-02-16 5:20 ` Balbir Singh
2016-02-16 5:20 ` Balbir Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d1ryfd94.fsf@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=bsingharora@gmail.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mgorman@techsingularity.net \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.