Re: [rfc 5/5] mincore: transparent huge page support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Weiner
Date: Wednesday, March 24, 2010 - 5:07 pm

On Wed, Mar 24, 2010 at 11:48:58PM +0100, Andrea Arcangeli wrote:

Stupid me.  I knew that, I just hadn't internalized it enough to do it
right :)

Btw, unless I miss something else, this is the same in follow_page()?

diff --git a/mm/memory.c b/mm/memory.c
index 22ee158..6c26042 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1301,18 +1301,14 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
 	}
 	if (pmd_trans_huge(*pmd)) {
 		spin_lock(&mm->page_table_lock);
-		if (likely(pmd_trans_huge(*pmd))) {
-			if (unlikely(pmd_trans_splitting(*pmd))) {
-				spin_unlock(&mm->page_table_lock);
-				wait_split_huge_page(vma->anon_vma, pmd);
-			} else {
-				page = follow_trans_huge_pmd(mm, address,
-							     pmd, flags);
-				spin_unlock(&mm->page_table_lock);
-				goto out;
-			}
-		} else
+		if (unlikely(pmd_trans_splitting(*pmd))) {
 			spin_unlock(&mm->page_table_lock);
+			wait_split_huge_page(vma->anon_vma, pmd);
+		} else {
+			page = follow_trans_huge_pmd(mm, address, pmd, flags);
+			spin_unlock(&mm->page_table_lock);
+			goto out;
+		}
 		/* fall through */
 	}
 	if (unlikely(pmd_bad(*pmd)))


True.


Agreed.


Knock yourself out :-)

	Hannes
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
mincore and transparent huge pages, Johannes Weiner, (Tue Mar 23, 7:34 am)
[patch 4/5] mincore: do nested page table walks, Johannes Weiner, (Tue Mar 23, 7:35 am)
[rfc 5/5] mincore: transparent huge page support, Johannes Weiner, (Tue Mar 23, 7:35 am)
Re: mincore and transparent huge pages, Andrea Arcangeli, (Wed Mar 24, 3:32 pm)
Re: [rfc 5/5] mincore: transparent huge page support, Andrea Arcangeli, (Wed Mar 24, 3:48 pm)
Re: [rfc 5/5] mincore: transparent huge page support, Johannes Weiner, (Wed Mar 24, 5:07 pm)
Re: [rfc 5/5] mincore: transparent huge page support, Andrea Arcangeli, (Wed Mar 24, 5:42 pm)
Re: [rfc 5/5] mincore: transparent huge page support, Johannes Weiner, (Wed Mar 24, 6:23 pm)