mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix VM_FAULT flags conversion for hugetlb
@ 2007-08-14 19:41 Adam Litke
  2007-08-16  2:50 ` Nick Piggin
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Litke @ 2007-08-14 19:41 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, Nick Piggin, wli, aglitke

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.

Signed-off-by: Adam Litke <agl@us.ibm.com>

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index d7ca59d..de4cf45 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -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;

-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center


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

* Re: [PATCH] Fix VM_FAULT flags conversion for hugetlb
  2007-08-14 19:41 [PATCH] Fix VM_FAULT flags conversion for hugetlb Adam Litke
@ 2007-08-16  2:50 ` Nick Piggin
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Piggin @ 2007-08-16  2:50 UTC (permalink / raw)
  To: Adam Litke; +Cc: akpm, linux-kernel, wli

On Tue, Aug 14, 2007 at 02:41:21PM -0500, Adam Litke wrote:
> 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.
> 
> Signed-off-by: Adam Litke <agl@us.ibm.com>

Thanks Adam. Looks good.

> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index d7ca59d..de4cf45 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -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;
> 
> -- 
> Adam Litke - (agl at us.ibm.com)
> IBM Linux Technology Center

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

end of thread, other threads:[~2007-08-16  2:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-14 19:41 [PATCH] Fix VM_FAULT flags conversion for hugetlb Adam Litke
2007-08-16  2:50 ` Nick Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®