Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75452
b: refs/heads/master
c: 68842c9
h: refs/heads/master
v: v3
  • Loading branch information
Ken Chen authored and Linus Torvalds committed Jan 14, 2008
1 parent 4f62c38 commit cabe252
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 747d016e7e25e216b31022fe2b012508d99fb682
refs/heads/master: 68842c9b94560e647e8e7cc75cbb3dbe59f6fcb5
13 changes: 10 additions & 3 deletions trunk/mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,14 @@ static struct page *alloc_huge_page_private(struct vm_area_struct *vma,
if (free_huge_pages > resv_huge_pages)
page = dequeue_huge_page(vma, addr);
spin_unlock(&hugetlb_lock);
if (!page)
if (!page) {
page = alloc_buddy_huge_page(vma, addr);
return page ? page : ERR_PTR(-VM_FAULT_OOM);
if (!page) {
hugetlb_put_quota(vma->vm_file->f_mapping, 1);
return ERR_PTR(-VM_FAULT_OOM);
}
}
return page;
}

static struct page *alloc_huge_page(struct vm_area_struct *vma,
Expand Down Expand Up @@ -1206,8 +1211,10 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to)
if (hugetlb_get_quota(inode->i_mapping, chg))
return -ENOSPC;
ret = hugetlb_acct_memory(chg);
if (ret < 0)
if (ret < 0) {
hugetlb_put_quota(inode->i_mapping, chg);
return ret;
}
region_add(&inode->i_mapping->private_list, from, to);
return 0;
}
Expand Down

0 comments on commit cabe252

Please sign in to comment.