From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755542AbcFQL5l (ORCPT ); Fri, 17 Jun 2016 07:57:41 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:24992 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753525AbcFQL5k (ORCPT ); Fri, 17 Jun 2016 07:57:40 -0400 From: zhongjiang To: , , , CC: , Subject: [PATCH] mm: fix account pmd page to the process Date: Fri, 17 Jun 2016 19:56:15 +0800 Message-ID: <1466164575-13578-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.5763E5A2.0191,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d9cefded89c5efe67074ec2484de9835 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: zhong jiang hen a process acquire a pmd table shared by other process, we increase the account to current process. otherwise, a race result in other tasks have set the pud entry. so it no need to increase it. Signed-off-by: zhong jiang --- mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 19d0d08..3072857 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4191,7 +4191,7 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud) (pmd_t *)((unsigned long)spte & PAGE_MASK)); } else { put_page(virt_to_page(spte)); - mm_inc_nr_pmds(mm); + mm_dec_nr_pmds(mm); } spin_unlock(ptl); out: -- 1.8.3.1