aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/huge_memory.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index dbe99a5f2073..113e35c47502 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1762,6 +1762,10 @@ static void collapse_huge_page(struct mm_struct *mm,
1762#ifndef CONFIG_NUMA 1762#ifndef CONFIG_NUMA
1763 VM_BUG_ON(!*hpage); 1763 VM_BUG_ON(!*hpage);
1764 new_page = *hpage; 1764 new_page = *hpage;
1765 if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) {
1766 up_read(&mm->mmap_sem);
1767 return;
1768 }
1765#else 1769#else
1766 VM_BUG_ON(*hpage); 1770 VM_BUG_ON(*hpage);
1767 /* 1771 /*
@@ -1781,12 +1785,12 @@ static void collapse_huge_page(struct mm_struct *mm,
1781 *hpage = ERR_PTR(-ENOMEM); 1785 *hpage = ERR_PTR(-ENOMEM);
1782 return; 1786 return;
1783 } 1787 }
1784#endif
1785 if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) { 1788 if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) {
1786 up_read(&mm->mmap_sem); 1789 up_read(&mm->mmap_sem);
1787 put_page(new_page); 1790 put_page(new_page);
1788 return; 1791 return;
1789 } 1792 }
1793#endif
1790 1794
1791 /* after allocating the hugepage upgrade to mmap_sem write mode */ 1795 /* after allocating the hugepage upgrade to mmap_sem write mode */
1792 up_read(&mm->mmap_sem); 1796 up_read(&mm->mmap_sem);