Received: by 10.213.65.68 with SMTP id h4csp268531imn; Fri, 16 Mar 2018 02:29:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELu4yKMjEXkVYQK/887/RcE4A4yIfKdDgKdgEEs5Blp+5jkVpZuOTqso3vg3XBbvxEC4cxbR X-Received: by 2002:a17:902:9a91:: with SMTP id w17-v6mr1374612plp.240.1521192555792; Fri, 16 Mar 2018 02:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521192555; cv=none; d=google.com; s=arc-20160816; b=rdzmxkOwd9d+ydfulvH6grqU0Opvha+SmntZnnDW8TfLvH9osuqelxIBztd/pgbXEA vLuYNsZ0o2z3zm+7i7Kp0ALp2YZ1TPWsmmcwhdgY/4iHS2Yzct4VEdpOS7Q1sDxuB9R4 xk6G/hwZcsU8rJlJYCI29ogUuBDxBEvUfKgDV+zZMP2EMTysXvbR2RLqFYq0/ElboDW0 xe8oR9lIs/a5bgg7r9T0mAPJn8rQ1qXgFbPNUeVxdwuCO4haRr9UaTOmojv4Rc2bu6MG 4Xcrt6S7fNQQbbyD5zmrqBdwGMs8hILVcpfuXrIXnzpsSpRZpHrK7vo5n0GylZWsP8RQ fPPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:dkim-signature:arc-authentication-results; bh=x0BCZSR6DRpPCvqyqJzND1XUbuVJTqWrNzSc7qOd/fE=; b=e8+x8uq1epOAE28KwpI0UFplgXtALLFk2+tzwKBprRQp4vEHAjdwfOXAYsk6aWkeT/ 6OXvanNhACIUvJUh3v2E1I1AQbwTLT8FTbbK1EqDGjEItQn8Z/fRQRHr8Q3XLpgi1wim KbN0c7nsXZpaDMV+CoEOijDt2qHF5oYzsVYLjrX7Pb5V22JwuarAm8P/W16MRpQDc5S+ dxP9Tm/YLwTnmh9D5ACXSrEhv4FtQYq3U+DqVQgAORxYdk4d/yHOkhV3Hmdw8vAoCDCE 7PFWB5rH21bDWPEaeu214RrA8YZPwOfJLJZvsN8tbc+i8sYh56k2YgD9WezQlXwSi5uL BnoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PuGKtsDz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m75si5278232pfg.64.2018.03.16.02.29.01; Fri, 16 Mar 2018 02:29:15 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PuGKtsDz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752802AbeCPJ1M (ORCPT + 99 others); Fri, 16 Mar 2018 05:27:12 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:38444 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752362AbeCPJ1K (ORCPT ); Fri, 16 Mar 2018 05:27:10 -0400 Received: by mail-it0-f65.google.com with SMTP id r10-v6so1004967iti.3 for ; Fri, 16 Mar 2018 02:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=x0BCZSR6DRpPCvqyqJzND1XUbuVJTqWrNzSc7qOd/fE=; b=PuGKtsDz2EX5PL60XbUwwjkXoJNywF8CFGv2XUm9tejU8GkCSYKaY2h/xhMuqT2q8C 5eda2eRsQg8xs0Xz2sB+WvLBQ1vc1yXn6OASnlKRHRGOiG8odDZXG8Id63azFpB3s1Di IlfX5OljrwOhvh56D2Sv77vR4XRb0AUiNp8kIkeT/lEEDXpF7fxBsXkk4XGm8tDkj1rp CGYBOPW5C4gvGMlquSNN3mBlty0VFK/xW/Qug/Ql8AIBZVOaGn4Se2vw9aRgC/S9Jeus uSbZUG+CtAvIvw+F4vhSm82POfnuFFRMk06o7gqCzrkMG5pPi1kjwvWRs89nUlEnqFuS TCjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=x0BCZSR6DRpPCvqyqJzND1XUbuVJTqWrNzSc7qOd/fE=; b=GB/PCMYwxBY6K4Gl1h4JukB1Frr03WJ7+NYNzzodxH11p10Svexa71BvMCec/JmbdC IOqlRyXLspjdj20iM02Y5Z8vhz0UEz6oRiVTyeRgtqHV2kEZ9OP7orfjv4evx8tMNfGM zQ60uIfrFQs/u7g+V16oEZxStdDHQhQXnMpiOVtywVmYrX1ZAA5mQLsxFuuGRKu/SfDo XkNR2NeEa9B6HLsthfWmStfHEAxr/zoVZigprnoC8MskNalhbx/tGHZ64zbuh3gxoySC klkyd4ekY7f2FPGA59T4JsRxJzfK9BbZ801zTjmUTyEbx6/+J7XjW2llAn8/ZX2P6Z2J JFQw== X-Gm-Message-State: AElRT7HRKxAxkKyHuuwyfL4F+dbfaQ2XV+vppEhk854sK7c/jtaBaeRj irSSO6iXYzq7cMTG8kbNqNE= X-Received: by 2002:a24:3dcb:: with SMTP id n194-v6mr1493665itn.6.1521192430035; Fri, 16 Mar 2018 02:27:10 -0700 (PDT) Received: from [0.0.0.0] (67.216.217.169.16clouds.com. [67.216.217.169]) by smtp.gmail.com with ESMTPSA id n123sm4351736itb.31.2018.03.16.02.27.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 02:27:09 -0700 (PDT) Subject: Re: [PATCH] Revert "mm/memblock.c: hardcode the end_pfn being -1" To: Michal Hocko 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 References: <1521168966-5245-1-git-send-email-hejianet@gmail.com> <20180316090647.GC23100@dhcp22.suse.cz> From: Jia He Message-ID: Date: Fri, 16 Mar 2018 17:26:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180316090647.GC23100@dhcp22.suse.cz> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. But seems parameter *max_pfn* is useless and can be removed in this case? 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 >>