From patchwork Thu Jul 12 09:50:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 10521391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A1466028E for ; Thu, 12 Jul 2018 09:50:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38BA1296B6 for ; Thu, 12 Jul 2018 09:50:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C5B7296BE; Thu, 12 Jul 2018 09:50:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDBE4296B6 for ; Thu, 12 Jul 2018 09:50:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EF606B0003; Thu, 12 Jul 2018 05:50:06 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8A1AD6B0006; Thu, 12 Jul 2018 05:50:06 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76A186B0007; Thu, 12 Jul 2018 05:50:06 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 144766B0003 for ; Thu, 12 Jul 2018 05:50:06 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id i202-v6so1750594wmf.9 for ; Thu, 12 Jul 2018 02:50:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:date:from:to :cc:subject:message-id:references:mime-version:content-disposition :in-reply-to:user-agent; bh=x8GlHenUVTblrxABr9RjxKpfsFx9IgUhTyykMzPVZAE=; b=V9526C8uGkxUq4nY8RQdwAz8J5dREIouZFvN3yYxiQKaeWfw6puou6CvEwhLqgbPyH JmrO8rBfusgnPeR23JPMpuzoVGRD1NLZoa7FJsjU2rIkqmasM2qXbtGDn5myTCZwx/yP cwXV972jVdFo6QvVk782Hylh0Zf3GwPrIP0pZIN7tiynZ3JM596ORWLIhNA/Lz1jb5ry bafn0TUjyUMVlJVGDq7eeixX5JfQ86xbc9jP4USrLDxcaCxoQrMqmPbEKcWaWV4Zcjvf HY8URuZr/3m4P5wPM2F/+b03Yp1AJ+V1H6bAl9HBIbRITLVd+SifS+BO3Fr5JBb6AOuc Ffnw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com X-Gm-Message-State: AOUpUlHW9dUN4P4c2s9tLyGSDuR+Z+XE/SYL2Y3feB6KQAzljrKG85JF rhni5pD2jCBMMLWR0UEJ6RMvWg7g5xGVYg9bbATi4QgmGUdmFr5p1eygb6mBktu0GlDZAnaY+lk lxBdsS8bmOvoL9I0cgs9Xu3YEFSNO5xD+usK2SDIN92q3KbhTVBXSSCkurV3dbFHravIa40yPkP 0TZcNbQWsRuuUQhyiNI5tkXvEGb3pbn7fYrv6uJcEdQWgDD2Lxy/1/9scHi6XUjs9fUy9qUPGUB 0+ZFTXsZUHqxeW4Jd5CWv3gdTSelN95Bm8loCJlXZ2yLUVB08Bq1N3AaANZwB/jmfssig+0Uswz mTnxrmL5SEl+7yKcOEUP/ptPC17CZyXDl09wNXQnp7vuP+IUqVSwbe4LNu+xvyuoLmZq5Flu4g= = X-Received: by 2002:adf:8276:: with SMTP id 109-v6mr1207429wrb.127.1531389005347; Thu, 12 Jul 2018 02:50:05 -0700 (PDT) X-Received: by 2002:adf:8276:: with SMTP id 109-v6mr1207371wrb.127.1531389004299; Thu, 12 Jul 2018 02:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531389004; cv=none; d=google.com; s=arc-20160816; b=Xw1tLISpcJ5X+ng5Wf1hhC+saS+8OQxsl9hadnoAzFu61xw+T+M1mHT9fMCcWZaa/v xVXZEpUhqjX0yIDM1KARa4mubU6YBurHdMIdeBO1M+LQ3cILj/loZg4Tlk2xGddDATsC QxY/pQryUhE0udqXA9uiEJv38Nme+pl0Ybr342pW53oADV6akdr96q5I44I6IEl/FbU9 /ywfyToq4r39LrELLFjLsa8lq95YyQbSDv334XUgNf6jjOyXKnE2zoqFIYmOc8k1XndI gVxS/Onw/Ui+1erOk2R5VO4QeZx/gZW5u70+w8CmxJy6hw0OuZ+IrHHEZgFwcnRm2NJF x2gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=x8GlHenUVTblrxABr9RjxKpfsFx9IgUhTyykMzPVZAE=; b=i/nBLz5APO1bJkIsg/Ukj5hdpw7VRjCZw7VFFbn5VgH3H4Zg88jDcW63gMH5U8kNPg hJ1ECGzZoOekq6AkBaIAckglxfnSa46vrTucBdn1TZBVIEzH7Kvro/hfqu0Cm1luPlZN sNkk1dIpQplDaScI+NmHzo6OjYPC7wwQDqa34ehI4AT4VTXycw84NTFBvG5lkohXB5D0 4UQph6iXVz7DSYRBRIJkGK+BB1l2bbikkL+lb2fIiOKsqPDWBMpUAYr9EkIriiTNK1Lw 4NVeL2V8N59ZQN0AG7RsMBQqXjfoySXygDx5+oqGusXICaLTycCwY7PRML41J7ovHbeG mk6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p18-v6sor1944970wrp.48.2018.07.12.02.50.04 for (Google Transport Security); Thu, 12 Jul 2018 02:50:04 -0700 (PDT) Received-SPF: pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com X-Google-Smtp-Source: AAOMgpcdAQBr+Wq/BNpm+/GBFpbd7SjAXdE+6UGx5LBIYbxZbupWWiKZvIy0jxoS6pRSDH8wr1Olsg== X-Received: by 2002:adf:d142:: with SMTP id b2-v6mr1151387wri.17.1531389003976; Thu, 12 Jul 2018 02:50:03 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id h1-v6sm28996544wri.90.2018.07.12.02.50.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 02:50:03 -0700 (PDT) Received: by techadventures.net (Postfix, from userid 1000) id 91C47123E38; Thu, 12 Jul 2018 11:50:02 +0200 (CEST) Date: Thu, 12 Jul 2018 11:50:02 +0200 From: Oscar Salvador To: Michael Ellerman Cc: Oscar Salvador , Pavel Tatashin , Andrew Morton , broonie@kernel.org, mhocko@suse.cz, Stephen Rothwell , linux-next@vger.kernel.org, linux-fsdevel@vger.kernel.org, Linux Memory Management List , LKML , mm-commits@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, bhe@redhat.com, aneesh.kumar@linux.ibm.com, khandual@linux.vnet.ibm.com Subject: Re: Boot failures with "mm/sparse: Remove CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER" on powerpc (was Re: mmotm 2018-07-10-16-50 uploaded) Message-ID: <20180712095002.GA5342@techadventures.net> References: <20180710235044.vjlRV%akpm@linux-foundation.org> <87lgai9bt5.fsf@concordia.ellerman.id.au> <20180711133737.GA29573@techadventures.net> <87efg981rd.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87efg981rd.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.5.23 (2014-03-12) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP > > I just roughly check, but if I checked the right place, > > vmemmap_populated() checks for the section to contain the flags we are > > setting in sparse_init_one_section(). > > Yes. > > > But with this patch, we populate first everything, and then we call > > sparse_init_one_section() in sparse_init(). > > As I said I could be mistaken because I just checked the surface. > > Yeah I think that's correct. > > This might just be a bug in our code, let me look at it a bit. I wonder if something like this could make the trick: I will try to grab a ppc server and try it out too. Thanks diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index 51ce091914f9..e281651f50cd 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c @@ -177,6 +177,8 @@ static __meminit void vmemmap_list_populate(unsigned long phys, vmemmap_list = vmem_back; } +static unsigned long last_addr_populated = 0; + int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, struct vmem_altmap *altmap) { @@ -191,7 +193,7 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, void *p; int rc; - if (vmemmap_populated(start, page_size)) + if (start + page_size <= last_addr_populated) continue; if (altmap) @@ -212,6 +214,7 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, __func__, rc); return -EFAULT; } + last_addr_populated = start + page_size; } I know it looks hacky, and chances are that are wrong, but could you give it a try?