[PATCH] hugetlb: add comment explaining reasons for Bus Errors
authorChristoph Lameter <clameter@engr.sgi.com>
Sun, 5 Feb 2006 07:27:55 +0000 (23:27 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 5 Feb 2006 19:06:53 +0000 (11:06 -0800)
I just spent some time researching a Bus Error.  Turns out that the huge
page fault handler can return VM_FAULT_SIGBUS for various conditions where
no huge page is available.

Add a note explaining the reasoning in the source.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Acked-by: William Lee Irwin III <wli@holomorphy.com>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/hugetlb.c

index b21d78c..ceb3ebb 100644 (file)
@@ -444,6 +444,15 @@ retry:
                page = alloc_huge_page(vma, address);
                if (!page) {
                        hugetlb_put_quota(mapping);
+                       /*
+                        * No huge pages available. So this is an OOM
+                        * condition but we do not want to trigger the OOM
+                        * killer, so we return VM_FAULT_SIGBUS.
+                        *
+                        * A program using hugepages may fault with Bus Error
+                        * because no huge pages are available in the cpuset, per
+                        * memory policy or because all are in use!
+                        */
                        goto out;
                }