* [PATCH] "Convert" hugetlbfs to use vm_ops->fault()
@ 2007-03-28 20:27 Adam Litke
2007-03-29 2:52 ` Nick Piggin
0 siblings, 1 reply; 2+ messages in thread
From: Adam Litke @ 2007-03-28 20:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm, Nick Piggin, William Lee Irwin III
Hi Andrew, I discovered that 2.6.21-rc5-mm1 was oopsing my box when running
the libhugetlbfs test suite. The trouble led me once again to shm stacked
files ;-) The stacked mmap function is labeling the lack of a ->fault()
vm_op a BUG() which is probably a good idea. It isn't really a problem for
hugetlbfs though, since our faults are handled by an explicit hook in
__handle_mm_fault(). Rather than removing the BUG(), just convert the
hugetlbfs ->nopage() placeholder to a ->fault() one which helps us get one
step closer to removing the nopage vm_op anyway.
Signed-off-by: Adam Litke <agl@us.ibm.com>
---
mm/hugetlb.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a07ffd4..89acb00 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -291,20 +291,19 @@ unsigned long hugetlb_total_pages(void)
}
/*
- * We cannot handle pagefaults against hugetlb pages at all. They cause
- * handle_mm_fault() to try to instantiate regular-sized pages in the
- * hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get
- * this far.
+ * Hugetlb faults are serviced in __handle_mm_fault by explicitly calling
+ * hugetlb_fault. Therefore the vm_ops->fault() op for hugetlb pages
+ * should never be called.
*/
-static struct page *hugetlb_nopage(struct vm_area_struct *vma,
- unsigned long address, int *unused)
+static struct page *hugetlb_vm_op_fault(struct vm_area_struct *vma,
+ struct fault_data *fdata)
{
BUG();
return NULL;
}
struct vm_operations_struct hugetlb_vm_ops = {
- .nopage = hugetlb_nopage,
+ .fault = hugetlb_vm_op_fault,
};
static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page,
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] "Convert" hugetlbfs to use vm_ops->fault()
2007-03-28 20:27 [PATCH] "Convert" hugetlbfs to use vm_ops->fault() Adam Litke
@ 2007-03-29 2:52 ` Nick Piggin
0 siblings, 0 replies; 2+ messages in thread
From: Nick Piggin @ 2007-03-29 2:52 UTC (permalink / raw)
To: Adam Litke; +Cc: Andrew Morton, linux-mm, William Lee Irwin III
Adam Litke wrote:
> Hi Andrew, I discovered that 2.6.21-rc5-mm1 was oopsing my box when running
> the libhugetlbfs test suite. The trouble led me once again to shm stacked
> files ;-) The stacked mmap function is labeling the lack of a ->fault()
> vm_op a BUG() which is probably a good idea. It isn't really a problem for
> hugetlbfs though, since our faults are handled by an explicit hook in
> __handle_mm_fault(). Rather than removing the BUG(), just convert the
> hugetlbfs ->nopage() placeholder to a ->fault() one which helps us get one
> step closer to removing the nopage vm_op anyway.
Thanks Adam. I thought I'd done hugetlb... oh well.
>
> Signed-off-by: Adam Litke <agl@us.ibm.com>
Acked-by: Nick Piggin <npiggin@suse.de>
--
SUSE Labs, Novell Inc.
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-29 2:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-28 20:27 [PATCH] "Convert" hugetlbfs to use vm_ops->fault() Adam Litke
2007-03-29 2:52 ` Nick Piggin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox