Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3341482imu; Sun, 9 Dec 2018 23:59:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/WpNskvEONfQl3yvN7nAXxMnnTqqnYrDC6zXd6TJziA3Nog52WPNZY4S0wb9bLHLJ2n/lkZ X-Received: by 2002:a63:2586:: with SMTP id l128mr10258749pgl.104.1544428760193; Sun, 09 Dec 2018 23:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544428760; cv=none; d=google.com; s=arc-20160816; b=HnwG52/rbabeS/KiYfNRftksBwGAVW26m+gWGDYdFLxbia2JnqXA8g/L8mc09+xhK2 JX0hlFrKnB2DWD6HO7M6eOZ+PckzGZG8ZQqSFsKy+4S+sRm39KlL/jHVozoqbfB1VjY6 D8/MCE1frLIZZJwRYxNzefiFHsH1l9OhqbrBvREC85NLKDRj4rz4jaiW7rJ28xQrk0qK 1v6qgU2XH50uRGRE2SxQbHfVPbfKgyuRnvY1gU1F9r5/Bc0wMZ0EzK0TKnNd/mP7ZTss 6Yd5g2KKn6up/xP9KiJeTCnUXuoBG73IhG9zt0vjfKMXJKJMtdu/0fL4nPDOnONgWr5G 1Gow== 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=0lK7e7MOQU8j6wHCV0p74SUnJiNIXtV3U2lQzw6nRSs=; b=maG9Nnzwm9bMsd3flBA/GpX4HswocY8d/RasiwELXNLV5C4/zVkUb7LlV+WFJmgC0E Y1+ZQsFVGYVH1Ng+LkcDbBfx7wLweAVvXrZiF7095rlzd0ivTjMFYu6P+WuDcZ5ZFCOX as4DkwmSiyt86Hn78guDDooHLQcDVfkS2eJiaGQp8/JvT9eya6jvE3+Itz4YErsNMC+j gxOzX/k2s8wKDKl/91JQMx1ZsuUlVKOgjtSPInKJhalorW6eECPhokLoMHoJ4SGH3ByN WupWdLG7+7Cvj+WDZ5TQ1jleI7dFwuA+3upBl0RglyomtjcnbF1BVFtTy8IljpaKzbBe SM3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XxW3UI5o; 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 l33si9869746pld.142.2018.12.09.23.59.04; Sun, 09 Dec 2018 23:59:20 -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=XxW3UI5o; 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 S1726525AbeLJH5R (ORCPT + 99 others); Mon, 10 Dec 2018 02:57:17 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:45119 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726158AbeLJH5Q (ORCPT ); Mon, 10 Dec 2018 02:57:16 -0500 Received: by mail-ed1-f67.google.com with SMTP id d39so8613007edb.12 for ; Sun, 09 Dec 2018 23:57:15 -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=0lK7e7MOQU8j6wHCV0p74SUnJiNIXtV3U2lQzw6nRSs=; b=XxW3UI5onXgbssvX/mZGF2N4Cuj7pb+9d/8gAchtOi90ksESrkECg3OAAPnwIiVpgz Sia4RjJRzNy9iwCCW9i3F2rbNY5uLKw+PQeKvY0M38rW5u3aDa9HlmmVqtb03rHXKgQv 1zCQxDl8ENiZOc8JUqk4HiKeGZd9EmZAay/ngSv2101Bk/sd/M2rmUPXCiJpFiKTLO9q jKG5h9CopUtu8sir+5sGiVhsk/ko/MVYqXLKFUm5GwimzpMaocTF2m5W1h6eK34FPHo5 dLeHJXP7wBokEsqQ+QWeAShDO4mjvt8LKcDe69K0UBzN40wIz9GlcdZMi/Cwijmc5nZ5 iwLg== 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=0lK7e7MOQU8j6wHCV0p74SUnJiNIXtV3U2lQzw6nRSs=; b=guA5Rq+mju++G0Gi9L7ZxFAh+uXBjC9ndS7zy8E0msNGFZeLwr9oMEm5h+pkC9i5sm AX1K4Ui9gQbgcWuu3ZHT8deZX2zrvltShmmcysgTJOeBXB4qxV6nR2g7dPo/Y5vQvpi6 Ri+3qzGHDDFcFBueBg/s5MmsvUIWCv9hkDLtbpLByRPui6uWDtJ1NSHv1xf6JRkJ8v5w lKjcMPBrYINmCroJZs0ftqdZjxoi+f7eyDxsFozomNHaOZq2mZjPlEYe5J+hkHctMqcE 968AYw1ns1YvMoQEASEC9C6XsPXrgo9JOwL2LQrNQZT0g+2kLQZJYEodnqWMHbEstEsN qwdQ== X-Gm-Message-State: AA+aEWZ4jlsWXomMXUHFhmjJoVhR8FcgvThVGxTxJFdoe+JcvmHNKucU SxHIp29NlyiROM5HnMOclN0VUN8Q/2xN0gMdkA== X-Received: by 2002:aa7:cf88:: with SMTP id z8mr10728458edx.208.1544428634965; Sun, 09 Dec 2018 23:57:14 -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: From: Pingfan Liu Date: Mon, 10 Dec 2018 15:57:02 +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 Mon, Dec 10, 2018 at 12:00 PM Pingfan Liu wrote: > > 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 A mistake, it should be node_online_map. and in free_area_init_nodes() for_each_online_node(nid) { free_area_init_node(nid, NULL,.. So at this time, we do not need to worry about the memory-less node. > free_area_init_node() for the node with memory. This logic is the > same as the current x86 code. > > Thanks, > Pingfan