Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp721799imu; Fri, 7 Dec 2018 07:58:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/V5X6W90V8/gDyfv0v2OsJExlGVtwFUWnRBOmlr72G0PZWbQDJcCOz6b0NFnTfFborZ5egn X-Received: by 2002:a63:4a4d:: with SMTP id j13mr2472027pgl.127.1544198289260; Fri, 07 Dec 2018 07:58:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544198289; cv=none; d=google.com; s=arc-20160816; b=fuIZquOf1+WnDxCLgCUiwe4OC1mOtxgGh7Tho+rHIJFMXOuBCqei6TIMMKiLJdo+Fv ur1dtFliYezNGZtRLbbOBuTjTiXE412OjlbjiGeevfnJJDHPiHTeusAXBh1N04yzANW/ qjH9JMn8kCtbV8DueVW/wUCbCumKLTNao5gV8QDSL1ls2xO0aQxgI7Y1cguO8F5Jf4WB ym+9Wl/s9pHZQdMpOZhQXv3HCOKH8I5T8vIPuzJuWtwBb99ZI8TdQMG2lX3QViuT5fW6 ZwvL6PiwMB9fh34wESrJejw0r2teN4yoJ3geFyOpdEprA5v+qY7ue6kiI8+8vtVQM2YW VHuQ== 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; bh=awgDmFdqBrppCRLAfRnb7EzS56mQjeVLpY4Y6Ox5LxA=; b=w/To5ABOt4Gpj1vxv7rzBF9LGuhNzZEnbANYxb2pPV4hNI83/ZDyTum9OTni+KO/ol 0/qeALmZOoC3B2QY3F+q1B0fXZJuyj7BIyFGK5HEydZSOtrMWC5++r9HGfEC0Cjtb5bC dpsm544f7REQdaxNXF533cUav+QFMqj/QEuAzReIYc+vpiOMfzgSq1A4Mwh3RMF65x2K /M2nDaPuIYaIfr9CfKAgLTZiTGnuzkx3CT2fM6IU6uP2DGYbCSFJV4z8wZOWY2ImS1eI dPMDmnMPIpe0ahQf+xphZYFmb/stJYfkHTkfGw4Sroc8ZcYTedE92Xv5AZVw/5m931ul xkcw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s38si2844801pga.38.2018.12.07.07.57.53; Fri, 07 Dec 2018 07:58:09 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726129AbeLGP4d (ORCPT + 99 others); Fri, 7 Dec 2018 10:56:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:33800 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726041AbeLGP4c (ORCPT ); Fri, 7 Dec 2018 10:56:32 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BA39EACBA; Fri, 7 Dec 2018 15:56:30 +0000 (UTC) Date: Fri, 7 Dec 2018 16:56:27 +0100 From: Michal Hocko To: Pingfan Liu Cc: Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Mike Rapoport , Bjorn Helgaas , Jonathan Cameron Subject: Re: [PATCH] mm/alloc: fallback to first node if the wanted node offline Message-ID: <20181207155627.GG1286@dhcp22.suse.cz> References: <20181206121152.GH1286@dhcp22.suse.cz> <20181207075322.GS1286@dhcp22.suse.cz> <20181207113044.GB1286@dhcp22.suse.cz> <20181207142240.GC1286@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Michal Hocko SUSE Labs