[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20141027184115.GX6911@redhat.com>
Date: Mon, 27 Oct 2014 19:41:15 +0100
From: Andrea Arcangeli <aarcange@...hat.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
James Bottomley <James.Bottomley@...senPartnership.com>,
David Miller <davem@...emloft.net>, akpm@...ux-foundation.org,
steve.capper@...aro.org, mpe@...erman.id.au, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-arch@...r.kernel.org, hannes@...xchg.org
Subject: Re: [PATCH V2 1/2] mm: Update generic gup implementation to handle
hugepage directory
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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists