From: akpm@linux-foundation.org
From: Adam Litke <agl@us.ibm.com>
To: torvalds@linux-foundation.org
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, agl@us.ibm.com,
bill.irwin@oracle.com, nickpiggin@yahoo.com.au
Subject: [patch 4/8] "Convert" hugetlbfs to use vm_ops->fault()
Date: Fri, 18 May 2007 00:37:08 -0700 [thread overview]
Message-ID: <200705180737.l4I7b7MM010762@shell0.pdx.osdl.net> (raw)
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>
Acked-by: Nick Piggin <nickpiggin@yahoo.com.au>
Acked-by: Bill Irwin <bill.irwin@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/hugetlb.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff -puN mm/hugetlb.c~convert-hugetlbfs-to-use-vm_ops-fault mm/hugetlb.c
--- a/mm/hugetlb.c~convert-hugetlbfs-to-use-vm_ops-fault
+++ a/mm/hugetlb.c
@@ -287,20 +287,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>
reply other threads:[~2007-05-18 7:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200705180737.l4I7b7MM010762@shell0.pdx.osdl.net \
--to=akpm@linux-foundation.org \
--cc=agl@us.ibm.com \
--cc=bill.irwin@oracle.com \
--cc=linux-mm@kvack.org \
--cc=nickpiggin@yahoo.com.au \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox