Skip to content

Commit

Permalink
[PATCH] hugetlb: add comment explaining reasons for Bus Errors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 5, 2006
1 parent fe1dcbc commit 64b4a95
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,15 @@ int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
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;
}

Expand Down

0 comments on commit 64b4a95

Please sign in to comment.