提交 0df420d8 编写于 作者: C Christoph Lameter 提交者: Linus Torvalds

[PATCH] hugetlbpage: return VM_FAULT_OOM on oom

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: NChristoph Lameter <clameter@sgi.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 a2dfef69
...@@ -391,12 +391,7 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -391,12 +391,7 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma,
if (!new_page) { if (!new_page) {
page_cache_release(old_page); page_cache_release(old_page);
return VM_FAULT_OOM;
/* 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;
} }
spin_unlock(&mm->page_table_lock); spin_unlock(&mm->page_table_lock);
...@@ -444,15 +439,7 @@ int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma, ...@@ -444,15 +439,7 @@ int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
page = alloc_huge_page(vma, address); page = alloc_huge_page(vma, address);
if (!page) { if (!page) {
hugetlb_put_quota(mapping); hugetlb_put_quota(mapping);
/* ret = VM_FAULT_OOM;
* 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; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册