All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: (not so much) Fun with THP
       [not found] <0d30dc$krvjbc@orsmga001.jf.intel.com>
@ 2011-01-25 17:57 ` Andrea Arcangeli
  2011-01-25 18:52   ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Andrea Arcangeli @ 2011-01-25 17:57 UTC (permalink / raw)
  To: Chris Wilson; +Cc: akpm, hannes, ryomov, linux-kernel

On Tue, Jan 25, 2011 at 03:58:30PM +0000, Chris Wilson wrote:
> On the one F15 box I've dared enable THP with, it hasn't succeeded in
> booting (with or without KMS).  First it OOMed during lvm:

Sorry, for x86_32 there was some issue, below is all you need, thanks!

diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 2071a8b..ebbc4d8 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -558,13 +558,12 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
 static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 			      pmd_t *pmdp, pmd_t pmd)
 {
-#if PAGETABLE_LEVELS >= 3
 	if (sizeof(pmdval_t) > sizeof(long))
 		/* 5 arg words */
 		pv_mmu_ops.set_pmd_at(mm, addr, pmdp, pmd);
 	else
-		PVOP_VCALL4(pv_mmu_ops.set_pmd_at, mm, addr, pmdp, pmd.pmd);
-#endif
+		PVOP_VCALL4(pv_mmu_ops.set_pmd_at, mm, addr, pmdp,
+			    native_pmd_val(pmd));
 }
 #endif
 
diff --git a/mm/Kconfig b/mm/Kconfig
index 3ad483b..e9c0c61 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -179,7 +179,7 @@ config SPLIT_PTLOCK_CPUS
 config COMPACTION
 	bool "Allow for memory compaction"
 	select MIGRATION
-	depends on EXPERIMENTAL && HUGETLB_PAGE && MMU
+	depends on MMU
 	help
 	  Allows the compaction of memory for the allocation of huge pages.
 
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 004c9c2..c4f634b 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1837,9 +1837,9 @@ static void collapse_huge_page(struct mm_struct *mm,
 	spin_lock(ptl);
 	isolated = __collapse_huge_page_isolate(vma, address, pte);
 	spin_unlock(ptl);
-	pte_unmap(pte);
 
 	if (unlikely(!isolated)) {
+		pte_unmap(pte);
 		spin_lock(&mm->page_table_lock);
 		BUG_ON(!pmd_none(*pmd));
 		set_pmd_at(mm, address, pmd, _pmd);
@@ -1856,6 +1856,7 @@ static void collapse_huge_page(struct mm_struct *mm,
 	anon_vma_unlock(vma->anon_vma);
 
 	__collapse_huge_page_copy(pte, new_page, vma, address, ptl);
+	pte_unmap(pte);
 	__SetPageUptodate(new_page);
 	pgtable = pmd_pgtable(_pmd);
 	VM_BUG_ON(page_count(pgtable) != 1);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: (not so much) Fun with THP
  2011-01-25 17:57 ` (not so much) Fun with THP Andrea Arcangeli
@ 2011-01-25 18:52   ` Chris Wilson
  2011-01-26  0:47     ` Kyle McMartin
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2011-01-25 18:52 UTC (permalink / raw)
  To: Andrea Arcangeli; +Cc: akpm, hannes, ryomov, linux-kernel

On Tue, 25 Jan 2011 18:57:06 +0100, Andrea Arcangeli <aarcange@redhat.com> wrote:
> On Tue, Jan 25, 2011 at 03:58:30PM +0000, Chris Wilson wrote:
> > On the one F15 box I've dared enable THP with, it hasn't succeeded in
> > booting (with or without KMS).  First it OOMed during lvm:
> 
> Sorry, for x86_32 there was some issue, below is all you need, thanks!

Thank you, I was missing the paravirt patch.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (not so much) Fun with THP
  2011-01-25 18:52   ` Chris Wilson
@ 2011-01-26  0:47     ` Kyle McMartin
  0 siblings, 0 replies; 3+ messages in thread
From: Kyle McMartin @ 2011-01-26  0:47 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Andrea Arcangeli, akpm, hannes, ryomov, linux-kernel

On Tue, Jan 25, 2011 at 06:52:55PM +0000, Chris Wilson wrote:
> On Tue, 25 Jan 2011 18:57:06 +0100, Andrea Arcangeli <aarcange@redhat.com> wrote:
> > On Tue, Jan 25, 2011 at 03:58:30PM +0000, Chris Wilson wrote:
> > > On the one F15 box I've dared enable THP with, it hasn't succeeded in
> > > booting (with or without KMS).  First it OOMed during lvm:
> > 
> > Sorry, for x86_32 there was some issue, below is all you need, thanks!
> 
> Thank you, I was missing the paravirt patch.

Thanks Chris, Andrea,

That explains a bug I've had users seeing which I cannot reproduce
(since I'm all on 64-bit...)

regards,
--Kyle

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-26  0:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0d30dc$krvjbc@orsmga001.jf.intel.com>
2011-01-25 17:57 ` (not so much) Fun with THP Andrea Arcangeli
2011-01-25 18:52   ` Chris Wilson
2011-01-26  0:47     ` Kyle McMartin

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.