]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] hugetlbpage: return VM_FAULT_OOM on oom
authorChristoph Lameter <clameter@engr.sgi.com>
Tue, 7 Feb 2006 20:58:30 +0000 (12:58 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 8 Feb 2006 00:12:31 +0000 (16:12 -0800)
Remove wrong and misleading comments.

Return VM_FAULT_OOM if the hugetlbpage fault handler cannot allocate a
page.  do_no_page will end up doing do_exit(SIGKILL).

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/hugetlb.c

index 3255ca420fc8273ef1be2e4685e9672fd5dfec65..67f29516662a4b9d3c2291731a2259808646f54c 100644 (file)
@@ -391,12 +391,7 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma,
 
        if (!new_page) {
                page_cache_release(old_page);
-
-               /* Logically this is OOM, not a SIGBUS, but an OOM
-                * could cause the kernel to go killing other
-                * processes which won't help the hugepage situation
-                * at all (?) */
-               return VM_FAULT_SIGBUS;
+               return VM_FAULT_OOM;
        }
 
        spin_unlock(&mm->page_table_lock);
@@ -444,15 +439,7 @@ 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!
-                        */
+                       ret = VM_FAULT_OOM;
                        goto out;
                }