mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-19 15:48:24 +00:00
mm/hugetlb.c: just use put_page_testzero() instead of page_count()
We test the page reference count is zero or not here, it can be a bug here if page refercence count is not zero. So we can just use put_page_testzero() instead of page_count(). Link: https://lkml.kernel.org/r/20201007170949.GA6416@rlk Signed-off-by: Hui Su <sh_def@163.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3f4b815a43
commit
e5dfacebe4
1 changed files with 1 additions and 2 deletions
|
@ -2014,8 +2014,7 @@ retry:
|
||||||
* This page is now managed by the hugetlb allocator and has
|
* This page is now managed by the hugetlb allocator and has
|
||||||
* no users -- drop the buddy allocator's reference.
|
* no users -- drop the buddy allocator's reference.
|
||||||
*/
|
*/
|
||||||
put_page_testzero(page);
|
VM_BUG_ON_PAGE(!put_page_testzero(page), page);
|
||||||
VM_BUG_ON_PAGE(page_count(page), page);
|
|
||||||
enqueue_huge_page(h, page);
|
enqueue_huge_page(h, page);
|
||||||
}
|
}
|
||||||
free:
|
free:
|
||||||
|
|
Loading…
Add table
Reference in a new issue