From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751817AbdEATcn (ORCPT ); Mon, 1 May 2017 15:32:43 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33620 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbdEATcT (ORCPT ); Mon, 1 May 2017 15:32:19 -0400 Date: Mon, 1 May 2017 21:32:14 +0200 From: Ingo Molnar To: Baoquan He Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Kees Cook , Thomas Garnier , Andrew Morton , Yasuaki Ishimatsu , Jinbum Park , Dave Hansen , "Kirill A. Shutemov" , Yinghai Lu , Dan Williams , Dave Young Subject: Re: [PATCH v2] x86/mm: Fix incorrect for loop count calculation in sync_global_pgds Message-ID: <20170501193214.fbozpx6dlrapsma3@gmail.com> References: <1493654135-16645-1-git-send-email-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1493654135-16645-1-git-send-email-bhe@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Baoquan He wrote: > arch/x86/mm/init_64.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > index 15173d3..dfa9edb 100644 > --- a/arch/x86/mm/init_64.c > +++ b/arch/x86/mm/init_64.c > @@ -96,7 +96,9 @@ void sync_global_pgds(unsigned long start, unsigned long end) > { > unsigned long address; > > - for (address = start; address <= end; address += PGDIR_SIZE) { > + for (address = start; address <= end; > + address = ALIGN(address + 1, PGDIR_SIZE)) { > + > const pgd_t *pgd_ref = pgd_offset_k(address); > struct page *page; This patch does not apply cleanly to tip:master. You can avoid the col80 problems by renaming 'address' to the canonical 'addr' name, the loop will become: for (addr = start; addr <= end; addr = ALIGN(addr + 1, PGDIR_SIZE)) { ... which fits into 80 cols. Thanks, Ingo