Received: by 10.213.65.68 with SMTP id h4csp295780imn; Fri, 16 Mar 2018 03:28:53 -0700 (PDT) X-Google-Smtp-Source: AG47ELsNIl36HKEp9wKq0Gg0LvaPRLYIORRgfVG4gxoZsn8u+bGVntrCbmELOEHhT8xqL12Xz1H1 X-Received: by 2002:a17:902:8349:: with SMTP id z9-v6mr1539807pln.163.1521196133283; Fri, 16 Mar 2018 03:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521196133; cv=none; d=google.com; s=arc-20160816; b=RC/AbE64s5vJOqB5fKOkTVpy60wgPUhEy2g6prVisKGrjqHqTVsd+YMDv5+2hLuBz3 M/qw7Jpv1s0sIdKOzB9Ke62w+ZXAc+nX/ZwQ+/H1zvvedj0xDe7NFhMpajxH21Uo0edi iWWJKspGm9DeFSCAGv6yZOlXnytz2VQ3F7DMp1oQldWx6FMGq5KhFSBGjekPAwqZIR6e pB+bWGUZ6OygieBoflAartluwFAHkIkcRPCbesxHnpU/ItOW5MSGXsYPryTLsly9S2pr lqX6BoFlLejHZcLWfcW5OwjSGayh1DjkZ56F8tc9PHiGCHQpBI56/vb3FJcFsJ4N2rQ1 JY+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=OWqQoCQ3GjMmToufpv16TNJDYLxZDMJwqAdIDp3wpdM=; b=GYmKKMFcw+urYlrtr5hQwwusfoK/Ks2w2HXoSC9QOoFDGC8o9Bq73YuZWWnkHIdUab 6XOw9U0BfdTX04wWpSAKRCBcQ9iH7Tx/CciPiGJPlRSfGptvMM5BQVtpzLr3V9OU8FVj LRiSs6UCNwwyhik2kYKP0cUQCeKJojQBPYyIlsleMj/CQFYLqakHgPEZeF35OFBMJAp9 Q/0WIkhbnH5BcU2ivYhI1a/QF3YybBdEplgnBVQkzdUo05hqJybO1xrQ4lz1Wx++oa0+ LRV7ADs4pr0AgfRVdQnu/hX9F5pL/ZuzMpxoYNNbQdPLmhxh82WrRFuFYenUmyof2y6i 0PSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si5330794pfl.312.2018.03.16.03.28.39; Fri, 16 Mar 2018 03:28:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753404AbeCPK1b (ORCPT + 99 others); Fri, 16 Mar 2018 06:27:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:36176 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752544AbeCPK12 (ORCPT ); Fri, 16 Mar 2018 06:27:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3C9C3ADE0; Fri, 16 Mar 2018 10:27:27 +0000 (UTC) Date: Fri, 16 Mar 2018 11:27:25 +0100 From: Michal Hocko To: Jia He Cc: Andrew Morton , linux-mm@kvack.org, Catalin Marinas , Pavel Tatashin , Ard Biesheuvel , AKASHI Takahiro , Gioh Kim , Daniel Vacek , linux-kernel@vger.kernel.org, Jia He Subject: Re: [PATCH] Revert "mm/memblock.c: hardcode the end_pfn being -1" Message-ID: <20180316102725.GG23100@dhcp22.suse.cz> References: <1521168966-5245-1-git-send-email-hejianet@gmail.com> <20180316090647.GC23100@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 16-03-18 17:26:57, Jia He wrote: > > > On 3/16/2018 5:06 PM, Michal Hocko Wrote: > > On Thu 15-03-18 19:56:06, Jia He wrote: > > > This reverts commit 379b03b7fa05f7db521b7732a52692448a3c34fe. > > > > > > Commit 864b75f9d6b0 ("mm/page_alloc: fix memmap_init_zone pageblock > > > alignment") introduced boot hang issues in arm/arm64 machines, so > > > Ard Biesheuvel reverted in commit 3e04040df6d4. But there is a > > > preparation patch for commit 864b75f9d6b0. So just revert it for > > > the sake of caution. > > Why? Is there anything wrong with this one? > I don't think there might be anything wrong. Justin for the sake of caution. > Please ignore this patch if you prefer to keep 379b03b7fa. We do not revert just if the patch is correct. I do not have strong preference for the patch but I also do not see anything wrong with it. > But seems parameter *max_pfn* is useless and can be removed in this case? A patch for that is already sitting in mmotm tree > Cheers, > Jia > > > Signed-off-by: Jia He > > > --- > > > mm/memblock.c | 10 +++++----- > > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > > > diff --git a/mm/memblock.c b/mm/memblock.c > > > index b6ba6b7..5a9ca2a 100644 > > > --- a/mm/memblock.c > > > +++ b/mm/memblock.c > > > @@ -1107,7 +1107,7 @@ unsigned long __init_memblock memblock_next_valid_pfn(unsigned long pfn, > > > struct memblock_type *type = &memblock.memory; > > > unsigned int right = type->cnt; > > > unsigned int mid, left = 0; > > > - phys_addr_t addr = PFN_PHYS(++pfn); > > > + phys_addr_t addr = PFN_PHYS(pfn + 1); > > > do { > > > mid = (right + left) / 2; > > > @@ -1118,15 +1118,15 @@ unsigned long __init_memblock memblock_next_valid_pfn(unsigned long pfn, > > > type->regions[mid].size)) > > > left = mid + 1; > > > else { > > > - /* addr is within the region, so pfn is valid */ > > > - return pfn; > > > + /* addr is within the region, so pfn + 1 is valid */ > > > + return min(pfn + 1, max_pfn); > > > } > > > } while (left < right); > > > if (right == type->cnt) > > > - return -1UL; > > > + return max_pfn; > > > else > > > - return PHYS_PFN(type->regions[right].base); > > > + return min(PHYS_PFN(type->regions[right].base), max_pfn); > > > } > > > /** > > > -- > > > 2.7.4 > > > -- Michal Hocko SUSE Labs