Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3200925imu; Sun, 9 Dec 2018 20:11:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/W0bWD0UGjaJSw9mXPWaEArDf0STYaXXbhwjpSJEE4qW4+MK9LT3L36skMX1sCvVG733oj6 X-Received: by 2002:a17:902:7588:: with SMTP id j8mr10877338pll.215.1544415091701; Sun, 09 Dec 2018 20:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544415091; cv=none; d=google.com; s=arc-20160816; b=ic7lsIDiRRFs2RWO/i+bkBOYvV03e3jfEXzyD8oiXnmrfWZxLrIeFKd4EvBNtwBQqA Kb+6stpD4BhWsV4J0iYukkYnYX1uqAi/TVnb4fbjwDkMCBRSRKojov6XTi1LVz9qMMX1 yEEreyVx3uQEGsX3jHIIqcBU34cyo4okJFMH0sKAfwRvgii04INvPkZPct4m0shZn2SB 4yBeEMzgV4tc0QhGkdT+dIQoBd7rxj5glQZ1yINIpT0PxhrV90u4TKf26a0UcY5JFlmD W0HlwC+A4VUDqPYRMsKQPTitxCgJicck4dkaN9A8X2nSZOyqQDviF6dnw21j1Yvf+DVi ywLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Tm6Lz0Gq3rNsyHZXFWF3JTzoIllqElfNczDvThKKAtg=; b=XFuT16yQu1PfHtEDhi4b49C4aprVBUxfP51igBHs74SZ5q+aY/Veyr5vHBPMtGg1oe 6SAGrjmOYhCLa1S+2FHhxu5vshu1G5JZqzIoOFsAU20Js4GMXMYGcArZZPnoiO90zXv2 Gc6wDedj7/0grLY1fAHvjoiHdhyF6g0tWvPeo5J28FHl6dgxx3Q/YhW959N8EVahEjZW 8Bz4wi5bdcLRW51Og3sC9eV9mjBULjEWLIpMLKp97so9WSdTtkLdhIceZxjZ6zLLAaOZ Fo5zvrdycINUtPfT0+KfqTWPuaq3j2jo6jTLJC0cJ8oVQgXhZVLmgUo89sglDhWGLMVd A9MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Bm1148zc; 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 y123si9693641pfy.18.2018.12.09.20.11.14; Sun, 09 Dec 2018 20:11:31 -0800 (PST) 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=Bm1148zc; 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 S1726441AbeLJEA4 (ORCPT + 99 others); Sun, 9 Dec 2018 23:00:56 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:34927 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbeLJEA4 (ORCPT ); Sun, 9 Dec 2018 23:00:56 -0500 Received: by mail-ed1-f68.google.com with SMTP id x30so8309192edx.2 for ; Sun, 09 Dec 2018 20:00:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Tm6Lz0Gq3rNsyHZXFWF3JTzoIllqElfNczDvThKKAtg=; b=Bm1148zcQRQemMCL2MhKQ4rIlq8GE/acWh19T9NgFWt+kBgb2cnM6CCxnNrwiCaPvQ uOaLOYk8K1NNy5gSXRiKm9bRMYzGL76QVkTKFU/qYtnhQeFnF3/XYFPJ3+MtACQL5Cj2 dLpj5a2RWq0BO33z93hPl5qJnFuwINXwEbl2SOTb95wgWn5wiIAWEAykPTKcbR8diz2p 0QAXkOsXEN0F5OSK4JteZPrz8mfhfCLHcTBuVcIMo8xwH95e2ZmAS7b1r9Pt1z0fw0yM 3JKxFOOMqK43MD0JVaQPW47AnjmZx5YRq2AObm4JXmiYxxQvTST/zqv/hlxi0oFn5GPo 9Viw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Tm6Lz0Gq3rNsyHZXFWF3JTzoIllqElfNczDvThKKAtg=; b=pm6JF2st85WcsdHegaKVS/MMrkTbGhBYV42AMqKaktwb/CBPZN/5YxXKSR34FjV4vz 2wXc6CYp3MX138wbvs5qmy7vNbfClA2OdKiIMi5e9nxsyMUHXC2LumDyyy+fRJ83NiI/ q/1g7laedBWqiPPozhGXh0IVRR4kmWGIfFgYzlmP9qD9j2ixHDEE0njUL9AifnPJFCXz 1VKQwAs3nr7FaSuvzudg7GsKz11PQjeXZ4+ejs13vW35qrJI5S9rakIX7KuQWSSz4eEY asjjuZ88VqABtSmFJlGdXQjKajGf0aFWDp6i28z6pX1eOoxQBrepoaUt2AmuINORgbGK 8cuQ== X-Gm-Message-State: AA+aEWbJXMznwTc7p/r+Zvl49xWNrfotweHchjPBPAO+CYWXIaGDeWiE HM9LFKDplVSZqtyxDvFc4poecZX8xjIT5M460nuVYOQ= X-Received: by 2002:aa7:d487:: with SMTP id b7mr9673796edr.256.1544414454227; Sun, 09 Dec 2018 20:00:54 -0800 (PST) MIME-Version: 1.0 References: <20181206121152.GH1286@dhcp22.suse.cz> <20181207075322.GS1286@dhcp22.suse.cz> <20181207113044.GB1286@dhcp22.suse.cz> <20181207142240.GC1286@dhcp22.suse.cz> <20181207155627.GG1286@dhcp22.suse.cz> In-Reply-To: <20181207155627.GG1286@dhcp22.suse.cz> From: Pingfan Liu Date: Mon, 10 Dec 2018 12:00:41 +0800 Message-ID: Subject: Re: [PATCH] mm/alloc: fallback to first node if the wanted node offline To: mhocko@kernel.org Cc: Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Mike Rapoport , Bjorn Helgaas , Jonathan Cameron Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 7, 2018 at 11:56 PM Michal Hocko wrote: > > On Fri 07-12-18 22:27:13, Pingfan Liu wrote: > [...] > > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c > > index 1308f54..4dc497d 100644 > > --- a/arch/x86/mm/numa.c > > +++ b/arch/x86/mm/numa.c > > @@ -754,18 +754,23 @@ void __init init_cpu_to_node(void) > > { > > int cpu; > > u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid); > > + int node, nr; > > > > BUG_ON(cpu_to_apicid == NULL); > > + nr = cpumask_weight(cpu_possible_mask); > > + > > + /* bring up all possible node, since dev->numa_node */ > > + //should check acpi works for node possible, > > + for_each_node(node) > > + if (!node_online(node)) > > + init_memory_less_node(node); > > I suspect there is no change if you replace for_each_node by > for_each_node_mask(nid, node_possible_map) > > here. If that is the case then we are probably calling > free_area_init_node too early. I do not see it yet though. Maybe I do not clearly get your meaning, just try to guess. But if you worry about node_possible_map, then it is dynamically set by alloc_node_data(). The map is changed after the first time to call free_area_init_node() for the node with memory. This logic is the same as the current x86 code. Thanks, Pingfan