Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756178Ab3FQIUo (ORCPT ); Mon, 17 Jun 2013 04:20:44 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57258 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751619Ab3FQIUm (ORCPT ); Mon, 17 Jun 2013 04:20:42 -0400 Date: Mon, 17 Jun 2013 10:20:40 +0200 From: Michal Hocko To: Wanpeng Li Cc: Andrew Morton , David Rientjes , "Kirill A. Shutemov" , Fengguang Wu , Rik van Riel , Andrew Shewmaker , Jiri Kosina , Namjae Jeon , Jan Kara , Tejun Heo , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 7/7] mm/pgtable: Don't accumulate addr during pgd prepopulate pmd Message-ID: <20130617082040.GC19194@dhcp22.suse.cz> References: <1371345290-19588-1-git-send-email-liwanp@linux.vnet.ibm.com> <1371345290-19588-7-git-send-email-liwanp@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1371345290-19588-7-git-send-email-liwanp@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1536 Lines: 48 On Sun 16-06-13 09:14:50, Wanpeng Li wrote: > The old codes accumulate addr to get right pmd, however, > currently pmds are preallocated and transfered as a parameter, > there is unnecessary to accumulate addr variable any more, this > patch remove it. > > Signed-off-by: Wanpeng Li Reviewed-by: Michal Hocko > --- > arch/x86/mm/pgtable.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c > index 17fda6a..cb787da 100644 > --- a/arch/x86/mm/pgtable.c > +++ b/arch/x86/mm/pgtable.c > @@ -240,7 +240,6 @@ static void pgd_mop_up_pmds(struct mm_struct *mm, pgd_t *pgdp) > static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[]) > { > pud_t *pud; > - unsigned long addr; > int i; > > if (PREALLOCATED_PMDS == 0) /* Work around gcc-3.4.x bug */ > @@ -248,8 +247,7 @@ static void pgd_prepopulate_pmd(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmds[]) > > pud = pud_offset(pgd, 0); > > - for (addr = i = 0; i < PREALLOCATED_PMDS; > - i++, pud++, addr += PUD_SIZE) { > + for (i = 0; i < PREALLOCATED_PMDS; i++, pud++) { > pmd_t *pmd = pmds[i]; > > if (i >= KERNEL_PGD_BOUNDARY) > -- > 1.8.1.2 > -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/