From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754149AbcFPLbT (ORCPT ); Thu, 16 Jun 2016 07:31:19 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:11377 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753824AbcFPLbS (ORCPT ); Thu, 16 Jun 2016 07:31:18 -0400 Message-ID: <57628DE2.1090501@huawei.com> Date: Thu, 16 Jun 2016 19:30:42 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Andrew Morton , CC: Linux Memory Management List , LKML Subject: Re: [PATCH] mm: fix account pmd page to the process References: <1466076175-23444-1-git-send-email-zhongjiang@huawei.com> In-Reply-To: <1466076175-23444-1-git-send-email-zhongjiang@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.57628E03.007C,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: a5d0a577133daf7f6949d3cafb371bcf Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/6/16 19:22, zhongjiang wrote: > From: zhong jiang > > when 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 | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 19d0d08..3b025c5 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -4189,10 +4189,9 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud) > if (pud_none(*pud)) { > pud_populate(mm, pud, > (pmd_t *)((unsigned long)spte & PAGE_MASK)); > - } else { > + } else > put_page(virt_to_page(spte)); > - mm_inc_nr_pmds(mm); > - } > + > spin_unlock(ptl); > out: > pte = (pte_t *)pmd_alloc(mm, pud, addr); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f197.google.com (mail-io0-f197.google.com [209.85.223.197]) by kanga.kvack.org (Postfix) with ESMTP id 6337F6B025F for ; Thu, 16 Jun 2016 07:32:30 -0400 (EDT) Received: by mail-io0-f197.google.com with SMTP id g13so86622882ioj.3 for ; Thu, 16 Jun 2016 04:32:30 -0700 (PDT) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com. [58.251.152.64]) by mx.google.com with ESMTPS id j192si20657317oib.1.2016.06.16.04.32.28 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 16 Jun 2016 04:32:29 -0700 (PDT) Message-ID: <57628DE2.1090501@huawei.com> Date: Thu, 16 Jun 2016 19:30:42 +0800 From: zhong jiang MIME-Version: 1.0 Subject: Re: [PATCH] mm: fix account pmd page to the process References: <1466076175-23444-1-git-send-email-zhongjiang@huawei.com> In-Reply-To: <1466076175-23444-1-git-send-email-zhongjiang@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , kirill.shutemov@linux.intel.com Cc: Linux Memory Management List , LKML On 2016/6/16 19:22, zhongjiang wrote: > From: zhong jiang > > when 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 | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 19d0d08..3b025c5 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -4189,10 +4189,9 @@ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud) > if (pud_none(*pud)) { > pud_populate(mm, pud, > (pmd_t *)((unsigned long)spte & PAGE_MASK)); > - } else { > + } else > put_page(virt_to_page(spte)); > - mm_inc_nr_pmds(mm); > - } > + > spin_unlock(ptl); > out: > pte = (pte_t *)pmd_alloc(mm, pud, addr); -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org