Skip to contentSkip to conversation

Fix VM_FAULT flags conversion for hugetlb

PATCH In review Adam Litke 2 participants 2 messages Aug 14, 2007 – Aug 16, 2007

Subsystems (2)
lore
Share & tools
lore

Adam Litke

author
#0 lore raw

PATCH 1/1 Fix VM_FAULT flags conversion for hugetlb

It seems a simple mistake was made when converting follow_hugetlb_page() over to the VM_FAULT flags bitmask stuff:

	(commit  83c54070ee1a2d05c89793884bea1a03f2851ed4).

By using the wrong bitmask, hugetlb_fault() failures are not being recognized. This results in an infinite loop whenever follow_hugetlb_page is involved in a failed fault.

mm/hugetlb.c +1 -1
index d7ca59d..de4cf45 100644
@@ -643,7 +643,7 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
 			spin_unlock(&mm->page_table_lock);
 			ret = hugetlb_fault(mm, vma, vaddr, 0);
 			spin_lock(&mm->page_table_lock);
-			if (!(ret & VM_FAULT_MAJOR))
+			if (!(ret & VM_FAULT_ERROR))
 				continue;
 
 			remainder = 0;
Signature · 2 lines
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
#1 lore raw
Quoted 9 lines · Adam Litke

It seems a simple mistake was made when converting follow_hugetlb_page() over to the VM_FAULT flags bitmask stuff:

	(commit  83c54070ee1a2d05c89793884bea1a03f2851ed4).

By using the wrong bitmask, hugetlb_fault() failures are not being recognized. This results in an infinite loop whenever follow_hugetlb_page is involved in a failed fault.

Thanks Adam. Looks good.

Quoted 18 lines
mm/hugetlb.c +1 -1
index d7ca59d..de4cf45 100644
@@ -643,7 +643,7 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
 			spin_unlock(&mm->page_table_lock);
 			ret = hugetlb_fault(mm, vma, vaddr, 0);
 			spin_lock(&mm->page_table_lock);
-			if (!(ret & VM_FAULT_MAJOR))
+			if (!(ret & VM_FAULT_ERROR))
 				continue;
 
 			remainder = 0;
Signature · 3 lines
-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center