Received: by 10.213.65.68 with SMTP id h4csp2165002imn; Mon, 2 Apr 2018 02:19:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx48p4NYk4N4eEnj3JuttlnVSLO4qp/WhVRgloo3TXnc8mzRea0kR7MW/265oD6Zv2A5MdYCI X-Received: by 2002:a17:902:7c8b:: with SMTP id y11-v6mr3749597pll.393.1522660752848; Mon, 02 Apr 2018 02:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522660752; cv=none; d=google.com; s=arc-20160816; b=qE/Hwx5xPoJodgeOTTgmGse7uHmP2Tdl5pkU6uLH3wMMtEG7mzThVYtLTb6ffCSn4K jBPRuJLVR0npGOixBx0O0VnRsvor/Z/JeXN6+bozFFMzDmiHg5NBqPHTQIbimkwPkhrY Kna1gwZJl4hbyph8aIy4DvNUqNc01zGxYzB9Q8JWx/TP70MA8Hfu0XGrXIp8Wod783ND BWKCb5dLdtEF+yxIfdv6CISPEdlnAJf4cu6q9TRorWOibpoZujlSP1T4ePD3uF76zJWb IbhrofHB8xCnddPGvcfMIOOPwWHMS7a3y3xplj/rKCIv+b5D/3Z1mD8Nma2zTQC5+s+V il6g== 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=pXuZyDWpjOyaCb4wQNQnGNqRROkpqBXlyuNPPQtOv5U=; b=kePitQG7+9VE8ZIt4FYVMdmIPQ7tfh0htutjyF+UAtBU+v6GfO6zQ8WW3txER+ay1w FxkmEOa7y5E5Wr6/nkTxQKjfIho7H0ZJ5WPixPqhClatYnFcsm+XtBmrX2ekmehd6Nad cTXK7QwNgTK0/uCB5IeBPxlCIivEa60RR8yXEma4fxa1xNhm6QtZK8b48DUwROi4agfz +YXQ1dyFqsSIAxhVWoS3afCbmesKBN8DMJAOstuMFFpSksyUmbNh1w/AlAhznXXazko4 H/LC+Z/3/z8JxiVeFCOq8nUBuEmwb3NKGZ6nKndH096WF4yHVVH4ZpaPNQuR70t2N6zS KPAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XgodPHSc; 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 a15si41063pff.107.2018.04.02.02.18.59; Mon, 02 Apr 2018 02:19:12 -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=XgodPHSc; 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 S1754209AbeDBJRy (ORCPT + 99 others); Mon, 2 Apr 2018 05:17:54 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:38256 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752257AbeDBJRw (ORCPT ); Mon, 2 Apr 2018 05:17:52 -0400 Received: by mail-pf0-f196.google.com with SMTP id y69so9137614pfb.5 for ; Mon, 02 Apr 2018 02:17:52 -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=pXuZyDWpjOyaCb4wQNQnGNqRROkpqBXlyuNPPQtOv5U=; b=XgodPHScBRFwnlNl60aS6pwCxethWfz5VqcX00qLa2v2Lk9VwAvUfr7I9612sJ4Epa uex4QO7FKjAN6j777S0gkcxuoYb1Yqk2VwCJGVEUNtLXHPQM7L08YL1B8PXkoH7ImFJs d3whnf95ebBynWidMZoqshVF9ZtcWdGMYXlEXa//jS7HWbX0OyPv9yE1/bYpPC2YB4xE GDMefcrVtaMFunAaky7PK/AC9/JGAnH3mBZgRydsCTR3T+nKalSf2OhlGeN/fzchl2k8 b20oOnD7r2sXY94aB/St+goVb3hHe8kz2WVFqDTZNp4HyY2f0uWotym+hN+2DBIiP6xq MBzA== 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=pXuZyDWpjOyaCb4wQNQnGNqRROkpqBXlyuNPPQtOv5U=; b=FbgKA9NopHkfLvJ1vmJZig+sC27qVs/t6TjvhGWH+MM6n6eilNVPV84jPgh28TCyrS 4AubzqB0HvAA0R7zf4SCq1DZJPS5lMZFBVKCW41sFMMmSA1ZiaRtUgxoqJAYP76jr9JP E+UBTS2NPRrw1IkeGmSnnWi61kPQt8mnKDuoUPa/Wj89YPhrU3JuPMRrnHY7kd1kdW28 Kk+X6KcH0EA+XjrI0bRGrFSTDH244yZ+wYqhmijMSRu5l4YYODAvTVhJmSmdesScdYWE 1BjFFMiWJeRip2NwtZOYGH0fOuRNZIjNg8er5mwPlOER1tinWuK2Yvwar21TBESOS7eR yWlQ== X-Gm-Message-State: AElRT7Hx2KJvSkUN5I4JDDbSOCcs6z0s6J9HSqAlyXrBWLWw97fXsJTU ly4J8Dwv0gNShVl8FzKNZ+k= X-Received: by 10.99.99.65 with SMTP id x62mr5739042pgb.157.1522660672145; Mon, 02 Apr 2018 02:17:52 -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 b9sm28682059pff.13.2018.04.02.02.17.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Apr 2018 02:17:51 -0700 (PDT) Subject: Re: [PATCH v3 1/5] mm: page_alloc: remain memblock_next_valid_pfn() when CONFIG_HAVE_ARCH_PFN_VALID is enable To: Wei Yang Cc: Andrew Morton , Michal Hocko , Catalin Marinas , Mel Gorman , Will Deacon , Mark Rutland , Ard Biesheuvel , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Pavel Tatashin , Daniel Jordan , AKASHI Takahiro , Gioh Kim , Steven Sistare , Daniel Vacek , Eugeniu Rosca , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, James Morse , Steve Capper , x86@kernel.org, Greg Kroah-Hartman , Kate Stewart , Philippe Ombredanne , Johannes Weiner , Kemi Wang , Petr Tesarik , YASUAKI ISHIMATSU , Andrey Ryabinin , Nikolay Borisov , Jia He References: <1522033340-6575-1-git-send-email-hejianet@gmail.com> <1522033340-6575-2-git-send-email-hejianet@gmail.com> <20180328091800.GB97260@WeideMacBook-Pro.local> <20180402081233.GA38180@WeideMacBook-Pro.local> From: Jia He Message-ID: <7288ce7c-7535-a5a1-7c7c-18456e431648@gmail.com> Date: Mon, 2 Apr 2018 17:17:35 +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: <20180402081233.GA38180@WeideMacBook-Pro.local> 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 4/2/2018 4:12 PM, Wei Yang Wrote: > On Wed, Mar 28, 2018 at 05:49:23PM +0800, Jia He wrote: >> >> On 3/28/2018 5:18 PM, Wei Yang Wrote: >>> Oops, I should reply this thread. Forget about the reply on another thread. >>> >>> On Sun, Mar 25, 2018 at 08:02:15PM -0700, Jia He wrote: >>>> Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns >>>> where possible") optimized the loop in memmap_init_zone(). But it causes >>>> possible panic bug. So Daniel Vacek reverted it later. >>>> >>> Why this has a bug? Do you have some link about it? >>> >>> If the audience could know the potential risk, it would be helpful to review >>> the code and decide whether to take it back. >> Hi Wei >> Paul firstly submit a commit b92df1de5 to improve the loop in >> memmap_init_zone. >> And Daniel tried to fix a bug_on panic issue on X86 in commit 864b75f9d6b >> because >> there is evidence that this bug_on was caused by b92df1de5 [1]. >> >> But things didn't get better, 864b75f9d6b caused booting hang issue on >> arm{64} [2] >> So maintainer decided to reverted both b92df1de5 and 864b75f9d6b >> >> [1] https://patchwork.kernel.org/patch/10251145/ >> [2] https://lkml.org/lkml/2018/3/14/469 > I took some time to look into the discussion, while the root cause seems not > clear now? > Frankly speaking, to me the root cause of that bug_on is not completedly clear :-) Daniel ever gave me some hints as followed, but currently I have no x86 platform to understand the details. "On arm and arm64, memblock is used by default. But generic version of pfn_valid() is based on mem sections and memblock_next_valid_pfn() does not always return the next valid one but skips more resulting in some valid frames to be skipped (as if they were invalid). And that's why kernel was eventually crashing on some !arm machines." -- Cheers, Jia