From: Andrea Arcangeli <aarcange@redhat.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
David Miller <davem@davemloft.net>,
akpm@linux-foundation.org, steve.capper@linaro.org,
mpe@ellerman.id.au, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-arch@vger.kernel.org, hannes@cmpxchg.org
Subject: Re: [PATCH V2 1/2] mm: Update generic gup implementation to handle hugepage directory
Date: Mon, 27 Oct 2014 19:41:15 +0100 [thread overview]
Message-ID: <20141027184115.GX6911@redhat.com> (raw)
In-Reply-To: <87fve9xulq.fsf@linux.vnet.ibm.com>
Hi Aneesh,
On Mon, Oct 27, 2014 at 11:28:41PM +0530, Aneesh Kumar K.V wrote:
> VM_BUG_ON(address & ~HPAGE_PMD_MASK);
> if (pmd_trans_huge(*pmdp)) {
> pmd = pmdp_get_and_clear(vma->vm_mm, address, pmdp);
> } else {
The only problematic path that needs IPI is the below one yes.
> /*
> * khugepaged calls this for normal pmd
> */
> pmd = *pmdp;
> pmd_clear(pmdp);
> /*
> * Wait for all pending hash_page to finish. This is needed
> * in case of subpage collapse. When we collapse normal pages
> * to hugepage, we first clear the pmd, then invalidate all
> * the PTE entries. The assumption here is that any low level
> * page fault will see a none pmd and take the slow path that
> * will wait on mmap_sem. But we could very well be in a
> * hash_page with local ptep pointer value. Such a hash page
> * can result in adding new HPTE entries for normal subpages.
> * That means we could be modifying the page content as we
> * copy them to a huge page. So wait for parallel hash_page
> * to finish before invalidating HPTE entries. We can do this
> * by sending an IPI to all the cpus and executing a dummy
> * function there.
> */
> kick_all_cpus_sync();
>
> We already do an IPI for ppc64.
Agreed, ppc64 is already covered.
sparc/arm seem to be using the generic pmdp_clear_flush implementation
instead, which just calls flush_tlb_range, so perhaps they aren't.
As above, the IPIs are only needed if the *pmd is not transhuge.
Thanks,
Andrea
--
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: Andrea Arcangeli <aarcange@redhat.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
David Miller <davem@davemloft.net>,
akpm@linux-foundation.org, steve.capper@linaro.org,
mpe@ellerman.id.au, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-arch@vger.kernel.org, hannes@cmpxchg.org
Subject: Re: [PATCH V2 1/2] mm: Update generic gup implementation to handle hugepage directory
Date: Mon, 27 Oct 2014 19:41:15 +0100 [thread overview]
Message-ID: <20141027184115.GX6911@redhat.com> (raw)
Message-ID: <20141027184115.N5skVlPOoi6tV65p1m-8D3Ry3S_CCapfemIpUv0o0ZU@z> (raw)
In-Reply-To: <87fve9xulq.fsf@linux.vnet.ibm.com>
Hi Aneesh,
On Mon, Oct 27, 2014 at 11:28:41PM +0530, Aneesh Kumar K.V wrote:
> VM_BUG_ON(address & ~HPAGE_PMD_MASK);
> if (pmd_trans_huge(*pmdp)) {
> pmd = pmdp_get_and_clear(vma->vm_mm, address, pmdp);
> } else {
The only problematic path that needs IPI is the below one yes.
> /*
> * khugepaged calls this for normal pmd
> */
> pmd = *pmdp;
> pmd_clear(pmdp);
> /*
> * Wait for all pending hash_page to finish. This is needed
> * in case of subpage collapse. When we collapse normal pages
> * to hugepage, we first clear the pmd, then invalidate all
> * the PTE entries. The assumption here is that any low level
> * page fault will see a none pmd and take the slow path that
> * will wait on mmap_sem. But we could very well be in a
> * hash_page with local ptep pointer value. Such a hash page
> * can result in adding new HPTE entries for normal subpages.
> * That means we could be modifying the page content as we
> * copy them to a huge page. So wait for parallel hash_page
> * to finish before invalidating HPTE entries. We can do this
> * by sending an IPI to all the cpus and executing a dummy
> * function there.
> */
> kick_all_cpus_sync();
>
> We already do an IPI for ppc64.
Agreed, ppc64 is already covered.
sparc/arm seem to be using the generic pmdp_clear_flush implementation
instead, which just calls flush_tlb_range, so perhaps they aren't.
As above, the IPIs are only needed if the *pmd is not transhuge.
Thanks,
Andrea
WARNING: multiple messages have this Message-ID (diff)
From: Andrea Arcangeli <aarcange@redhat.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: linux-arch@vger.kernel.org, steve.capper@linaro.org,
hannes@cmpxchg.org, linux-kernel@vger.kernel.org,
James Bottomley <James.Bottomley@HansenPartnership.com>,
linux-mm@kvack.org, akpm@linux-foundation.org,
linuxppc-dev@lists.ozlabs.org, David Miller <davem@davemloft.net>
Subject: Re: [PATCH V2 1/2] mm: Update generic gup implementation to handle hugepage directory
Date: Mon, 27 Oct 2014 19:41:15 +0100 [thread overview]
Message-ID: <20141027184115.GX6911@redhat.com> (raw)
In-Reply-To: <87fve9xulq.fsf@linux.vnet.ibm.com>
Hi Aneesh,
On Mon, Oct 27, 2014 at 11:28:41PM +0530, Aneesh Kumar K.V wrote:
> VM_BUG_ON(address & ~HPAGE_PMD_MASK);
> if (pmd_trans_huge(*pmdp)) {
> pmd = pmdp_get_and_clear(vma->vm_mm, address, pmdp);
> } else {
The only problematic path that needs IPI is the below one yes.
> /*
> * khugepaged calls this for normal pmd
> */
> pmd = *pmdp;
> pmd_clear(pmdp);
> /*
> * Wait for all pending hash_page to finish. This is needed
> * in case of subpage collapse. When we collapse normal pages
> * to hugepage, we first clear the pmd, then invalidate all
> * the PTE entries. The assumption here is that any low level
> * page fault will see a none pmd and take the slow path that
> * will wait on mmap_sem. But we could very well be in a
> * hash_page with local ptep pointer value. Such a hash page
> * can result in adding new HPTE entries for normal subpages.
> * That means we could be modifying the page content as we
> * copy them to a huge page. So wait for parallel hash_page
> * to finish before invalidating HPTE entries. We can do this
> * by sending an IPI to all the cpus and executing a dummy
> * function there.
> */
> kick_all_cpus_sync();
>
> We already do an IPI for ppc64.
Agreed, ppc64 is already covered.
sparc/arm seem to be using the generic pmdp_clear_flush implementation
instead, which just calls flush_tlb_range, so perhaps they aren't.
As above, the IPIs are only needed if the *pmd is not transhuge.
Thanks,
Andrea
next prev parent reply other threads:[~2014-10-27 18:41 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-17 4:38 [PATCH V2 1/2] mm: Update generic gup implementation to handle hugepage directory Aneesh Kumar K.V
2014-10-17 4:38 ` Aneesh Kumar K.V
2014-10-17 4:38 ` Aneesh Kumar K.V
2014-10-17 4:38 ` [PATCH V2 2/2] arch/powerpc: Switch to generic RCU get_user_pages_fast Aneesh Kumar K.V
2014-10-17 4:38 ` Aneesh Kumar K.V
2014-10-17 4:38 ` Aneesh Kumar K.V
2014-10-17 14:10 ` [PATCH V2 1/2] mm: Update generic gup implementation to handle hugepage directory Steve Capper
2014-10-17 14:10 ` Steve Capper
2014-10-17 14:10 ` Steve Capper
2014-10-22 23:02 ` Andrew Morton
2014-10-22 23:02 ` Andrew Morton
2014-10-22 23:02 ` Andrew Morton
2014-10-23 4:28 ` Aneesh Kumar K.V
2014-10-23 4:28 ` Aneesh Kumar K.V
2014-10-23 4:28 ` Aneesh Kumar K.V
2014-10-23 8:08 ` Aneesh Kumar K.V
2014-10-23 8:08 ` Aneesh Kumar K.V
2014-10-23 8:08 ` Aneesh Kumar K.V
2014-10-23 22:40 ` David Miller
2014-10-23 22:40 ` David Miller
2014-10-23 22:40 ` David Miller
2014-10-23 23:40 ` Benjamin Herrenschmidt
2014-10-23 23:40 ` Benjamin Herrenschmidt
2014-10-23 23:40 ` Benjamin Herrenschmidt
2014-10-24 3:55 ` David Miller
2014-10-24 3:55 ` David Miller
2014-10-24 3:55 ` David Miller
2014-10-24 8:33 ` Steve Capper
2014-10-24 8:33 ` Steve Capper
2014-10-24 8:33 ` Steve Capper
2014-10-24 16:22 ` James Bottomley
2014-10-24 16:22 ` James Bottomley
2014-10-24 16:22 ` James Bottomley
2014-10-26 20:50 ` Benjamin Herrenschmidt
2014-10-26 20:50 ` Benjamin Herrenschmidt
2014-10-26 20:50 ` Benjamin Herrenschmidt
2014-10-27 0:18 ` Andrea Arcangeli
2014-10-27 0:18 ` Andrea Arcangeli
2014-10-27 0:18 ` Andrea Arcangeli
2014-10-27 17:58 ` Aneesh Kumar K.V
2014-10-27 17:58 ` Aneesh Kumar K.V
2014-10-27 17:58 ` Aneesh Kumar K.V
2014-10-27 18:41 ` Andrea Arcangeli [this message]
2014-10-27 18:41 ` Andrea Arcangeli
2014-10-27 18:41 ` Andrea Arcangeli
2014-10-25 10:30 ` Aneesh Kumar K.V
2014-10-25 10:30 ` Aneesh Kumar K.V
2014-10-25 10:30 ` Aneesh Kumar K.V
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=20141027184115.GX6911@redhat.com \
--to=aarcange@redhat.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=hannes@cmpxchg.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=steve.capper@linaro.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.