]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
thp: fix the count of THP_COLLAPSE_ALLOC
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Wed, 26 Sep 2012 01:33:21 +0000 (11:33 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Sep 2012 07:25:52 +0000 (17:25 +1000)
THP_COLLAPSE_ALLOC is double counted if NUMA is disabled since it has
already been calculated in khugepaged_alloc_hugepage

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c

index 18ef053ab37f060c38ccd161a8fe8fc2d767efe7..d4b257197bb7d6b4629f918ebc75cda1101ebdfc 100644 (file)
@@ -1959,9 +1959,9 @@ static void collapse_huge_page(struct mm_struct *mm,
                *hpage = ERR_PTR(-ENOMEM);
                return;
        }
+       count_vm_event(THP_COLLAPSE_ALLOC);
 #endif
 
-       count_vm_event(THP_COLLAPSE_ALLOC);
        if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) {
 #ifdef CONFIG_NUMA
                put_page(new_page);