]> 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>
Fri, 7 Sep 2012 00:23:37 +0000 (10:23 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 12 Sep 2012 07:08:27 +0000 (17:08 +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 8b3c55a7c07069c3a2bc7109b5eae5072eda5ce4..258c018fb3f1246cf73a7dc486e30e9ff19eba28 100644 (file)
@@ -1875,9 +1875,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);