Thread (50 messages) 50 messages, 6 authors, 2012-08-02

Re: [PATCH -alternative] mm: hugetlbfs: Close race during teardown of hugetlbfs shared page tables V2 (resend)

From: Larry Woodman <hidden>
Date: 2012-07-27 10:11:09
Also in: lkml

On 07/26/2012 11:48 PM, Larry Woodman wrote:


Mel, did you see this???

Larry
quoted hunk ↗ jump to hunk
quoted
This patch looks good to me.

Larry, does Hugh's patch survive your testing?
Like I said earlier, no.  However, I finally set up a reproducer that 
only takes a few seconds
on a large system and this totally fixes the problem:

------------------------------------------------------------------------------------------------------------------------- 
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index c36febb..cc023b8 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2151,7 +2151,7 @@ int copy_hugetlb_page_range(struct mm_struct 
*dst, struct mm_struct *src,
                        goto nomem;

                /* If the pagetables are shared don't copy or take 
references */
-               if (dst_pte == src_pte)
+               if (*(unsigned long *)dst_pte == *(unsigned long 
*)src_pte)
                        continue;

                spin_lock(&dst->page_table_lock);
--------------------------------------------------------------------------------------------------------------------------- 


When we compare what the src_pte & dst_pte point to instead of their 
addresses everything works,
I suspect there is a missing memory barrier somewhere ???

Larry
--
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help