Received: by 10.213.65.68 with SMTP id h4csp2924843imn; Mon, 2 Apr 2018 17:15:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx4//Aq72p/RjRbBlfxOWnXN1XmWqEsl8Ys3xLd/M6EyDOQbeobmNpv8CGU+IgZuJRGanll+r X-Received: by 10.99.113.85 with SMTP id b21mr7499602pgn.415.1522714531258; Mon, 02 Apr 2018 17:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522714531; cv=none; d=google.com; s=arc-20160816; b=c9+tTQj2sx6bY21nUjHGTyYdDLnclEsJ0X63O6ltrJifvKC6I6JOpm4abPvSe1QyUd HCt6XV4WADhXP+JaeLru0YPo9sLb4ITv5rMbQnVJQFvePmP/nqSB0L/TTwdpIZ9hr8GR 2vzknTbz9KPPAN0zu2KHcDooS86fIPtLojxufLB1DQzrRelaHJA3+qdDHvhMbCsZaQKg qCUBeUr7MBYXWSDD43CcxZR5kogJGdz6UHU7MPl+WWGdbEDeMVarKTbVm+wj1xn0hCGK j8Se37A5nXlX6JVi8ztkXazbTmRID8hR4awGQm3T3EHaJUKHnffQv1YqgHkYpnwzpJp3 0bUA== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature:arc-authentication-results; bh=7+eVO1s8MLK3CLv9HCrIIDCfEOK3ucaxv0tgklxlF0A=; b=hayEGWu9qgxg2F47MHvg1t/5PrZDrJIwpTKy0flJctGkCsFboG1h/dX2gH5P6X7NpL QLS1VA6sAvf3cTTR0yjFyu4j2Mn2YnE15MoICdOEdTagB8vNHwQjKhKMyMp4FJz1m61M xFmDGZlqNu5fVi9JQuiThgEEZL/MJbA0KO+RAauub5t/uMvHO8LuQLLq+h0R4qNxgIcz AejG/21TdXX8E1O9qtTQpfHemGtu+c3DqTecE8umZuJsxqpa+Yt4KBmWTu35Sfn8qvWP JSpdQEbAf/jhLkSfacb5XnLtIePy3dWVGOjnQ7SVQdqvSBWyJYIor/dYz0HNVOpnoyab ixpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iWlnOuf/; 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 u91-v6si1458811plb.698.2018.04.02.17.15.17; Mon, 02 Apr 2018 17:15:31 -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=iWlnOuf/; 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 S1754694AbeDCAOK (ORCPT + 99 others); Mon, 2 Apr 2018 20:14:10 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38165 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754550AbeDCAOJ (ORCPT ); Mon, 2 Apr 2018 20:14:09 -0400 Received: by mail-pl0-f67.google.com with SMTP id k6-v6so1262910pls.5 for ; Mon, 02 Apr 2018 17:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7+eVO1s8MLK3CLv9HCrIIDCfEOK3ucaxv0tgklxlF0A=; b=iWlnOuf/8PKFuOZw/p/m0CkkvfQkh6pRhrph83ZHFsB9icqUEyxomsv/swquCW8LzL U05FbA62fIIl6DWEy+RoSVV0d1lHly/n6p+oeN8k+VjSI/Ml9V29f6/cRxIEyY9icMri Rfw7YMLrVrljy1j42zp4jPSWzNHFoQC4+8EOIXWsqdXc4kfW/LjjWr1p+5TkuW5+2NuI b2Ex4cRTJQ8fgN2s+BvZf2VHB4HncfHTgiCy8WC7q0qSZ1NRMgm+2JdwLtn+LideaF3/ 2Zr7DrpUPiet8fnSGbZllTtdL89ApRf8HG9F2MHXVbTUeZ5AunJ+IHwtc8ck1c+3q8GA /rDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=7+eVO1s8MLK3CLv9HCrIIDCfEOK3ucaxv0tgklxlF0A=; b=KLNS2huQKvKw5VtgUtpHKp1LNNz37fqBrnReXl+SdaxzglXZLTlJIGDJn0IZT4y+nK R74xco7ufG4LfcNWiLzPG6hcAwlrNYX+KLUCN9Bcph+GzeLfuKAJpKz2G9pvhVuBI/Ud 0F92Luirr3OKi27HDZCcfa92EayS3ntfzGU5H3qcycTcpXna+a0F1T9+hCtXVHk1H4xm XmTGREyiy/VyJSAyWzO2+IL7sPkZsBWisAibqFJDbHE+98ELQHlvvKTqjo1SmtF3LMrx Rf2Z19p5syKhAMdpRmucr5+rVL+HJ8RMfgkBbPAwwGXVghMJ6lS4MAgsz7yltdt107Fl EcBw== X-Gm-Message-State: AElRT7HeqHwqBZiYntuyJqqSO29aXD82jiDnhl1VAiOYl6BlqGqUbhcb WeStTFo/PjfTTaRFQyOD2Sg= X-Received: by 10.101.77.145 with SMTP id p17mr7588973pgq.275.1522714449078; Mon, 02 Apr 2018 17:14:09 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id p5sm2101014pgv.4.2018.04.02.17.14.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Apr 2018 17:14:08 -0700 (PDT) Date: Tue, 3 Apr 2018 08:14:01 +0800 From: Wei Yang To: Jia He Cc: Wei Yang , 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 Subject: Re: [PATCH v3 1/5] mm: page_alloc: remain memblock_next_valid_pfn() when CONFIG_HAVE_ARCH_PFN_VALID is enable Message-ID: <20180403001401.GA45531@WeideMacBook-Pro.local> Reply-To: Wei Yang 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> <7288ce7c-7535-a5a1-7c7c-18456e431648@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7288ce7c-7535-a5a1-7c7c-18456e431648@gmail.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 02, 2018 at 05:17:35PM +0800, Jia He wrote: > > >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." > This means a system with memblock is safe to use this function? As I know, mem_section is based on memblock, so in which case memblock_next_valid_pfn() skips a valid pfn? A little confused. >-- >Cheers, >Jia -- Wei Yang Help you, Help me