Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87091
b: refs/heads/master
c: 2668db9
h: refs/heads/master
i:
  87089: 97e2539
  87087: f49b2b3
v: v3
  • Loading branch information
Adam Litke authored and Linus Torvalds committed Mar 11, 2008
1 parent 44bbd2d commit 06e7eb1
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: 842078054da2d754c6b998b116d7c468abbfaaca
refs/heads/master: 2668db9111bb1a6ab5a54f41f703179f35c7d098
13 changes: 10 additions & 3 deletions trunk/mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ static struct page *alloc_buddy_huge_page(struct vm_area_struct *vma,

spin_lock(&hugetlb_lock);
if (page) {
/*
* This page is now managed by the hugetlb allocator and has
* no users -- drop the buddy allocator's reference.
*/
put_page_testzero(page);
VM_BUG_ON(page_count(page));
nid = page_to_nid(page);
set_compound_page_dtor(page, free_huge_page);
/*
Expand Down Expand Up @@ -369,13 +375,14 @@ static int gather_surplus_pages(int delta)
enqueue_huge_page(page);
else {
/*
* Decrement the refcount and free the page using its
* destructor. This must be done with hugetlb_lock
* The page has a reference count of zero already, so
* call free_huge_page directly instead of using
* put_page. This must be done with hugetlb_lock
* unlocked which is safe because free_huge_page takes
* hugetlb_lock before deciding how to free the page.
*/
spin_unlock(&hugetlb_lock);
put_page(page);
free_huge_page(page);
spin_lock(&hugetlb_lock);
}
}
Expand Down

0 comments on commit 06e7eb1

Please sign in to comment.