Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1490435imm; Thu, 12 Jul 2018 02:50:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeUlBk31l2X2llqvOkHaLKCWSDv9BqHkuZrAOrzkC44d5gbUHqQbnLkEXPcRYkHo4a+jshF X-Received: by 2002:a62:4cd3:: with SMTP id e80-v6mr1612793pfj.234.1531389059251; Thu, 12 Jul 2018 02:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531389059; cv=none; d=google.com; s=arc-20160816; b=cgCw6KVJWXHz/0pu+EJ6DvhVRprzGd1WSTBUTwJZAv+fwxBJhz/K2bRC5XR0SyM3+c 2/VDxZquV/EnB9HuBruD9pVjCFVb7rIP/wbMh2plmAE4OniNPY6L3Fj1fw4aS9hz502v wOQv5dm/uSNvkrFk4bM5reOMjpPGL8im6lydKSFA0VTr0NAKl7fjIjPhi5PCavJyPVPR jZc2byWtrpRvO5Z+YuK2O0Z2ZDk/FL7Cej1LU48lJgRY8M6nt3NZKm6y9XB7n37Yn7Ja S+xfcw1Pdug2DjNip3JAXI19avSyFn+MwlMLZbb/zJKv4CZNLHwmgY4WqoYyRu61w5Z+ ZDpA== 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=x8GlHenUVTblrxABr9RjxKpfsFx9IgUhTyykMzPVZAE=; b=1LfbEeMF3dvVY9e5TEW7iMVx8iEWtN7dLpdJWWYeqVCNkoFirDR/1rrg7LkF+WqFQB 3damiDv6DqD8cdO/tF60IAVAHNsMKC5BIN6kySBXRRuvhUdEP+OtervxjGTycqW1s7TS n1qA4YIxj6ohZ5gOaOtx+MIomDLeCdxkqwrg/Tl5FERgbCN+lWBWrU1vqLOcPLf/NIZb kdiUAOiY+W+8sI5v/fJq0InFD2ecmA0u/ayKOT5k6pbZKdLrWDCIFRt4fJH/7He2WxPO xGLdliip0eikFY48AHpgBycBr8mNN3y5KDDRxBUfGfZvLmvA4eiAeBDyPeb0pNVMtQIg MSCA== 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 c18-v6si19733793pgp.467.2018.07.12.02.50.43; Thu, 12 Jul 2018 02:50:59 -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 S1726701AbeGLJ6y (ORCPT + 99 others); Thu, 12 Jul 2018 05:58:54 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42392 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbeGLJ6y (ORCPT ); Thu, 12 Jul 2018 05:58:54 -0400 Received: by mail-wr1-f67.google.com with SMTP id e7-v6so1462620wrs.9; Thu, 12 Jul 2018 02:50:04 -0700 (PDT) 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=x8GlHenUVTblrxABr9RjxKpfsFx9IgUhTyykMzPVZAE=; b=qZm5m7sYs6RfxjqOsEi4fS39PlmsZoAA5sVolgg4HT4AjCA9n2h2XdweC8bgxJPEZj QceNKtFBy2RBpyR7hv6XalZzOMrD+8rWNuSmUQ3idEHvibwZhuxs0uE0nuZBDDOgigFq ZHShWMEn5jjCVbhYquLsVYuZPEAnYj3k+tugV9Ys3Icpal8PZZSQczrift7skp1s/J6K C8BxyUPoy6El0AiMhlridE9WGrUID+2o5u7OB2q2k/zbWVVwSvNdaRi+X0khcp1nhAKa 0/XKBGBLG8U+OJJbJ7teLZXX0kuE/ntVCQiBumldMvuEpyQIPP9c/CL9MvOq442aNS9a FkOQ== X-Gm-Message-State: AOUpUlHgOHbSklE9x2rEvflzSDkpOe93k5/9wW5Jy9bkkdYixIAAleDH RXkNCKCRfzHdKzKfe1mxFsA= 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87efg981rd.fsf@concordia.ellerman.id.au> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > 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: 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? I will try to grab a ppc server and try it out too. Thanks -- Oscar Salvador SUSE L3