Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10499452imu; Thu, 6 Dec 2018 02:05:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/We1waAoc3ke/lojnMsBffRRV9mggtWxiJHm3FQV0BcwQyl8awMWFi9xZpzJq/0Iu0Q/ngx X-Received: by 2002:a17:902:48:: with SMTP id 66mr26513077pla.68.1544090741601; Thu, 06 Dec 2018 02:05:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544090741; cv=none; d=google.com; s=arc-20160816; b=DC3ZCoBnXoompuKpdn1lx1yC5wFS21oEKtarYGmbydhj69pTI/5KyYdRGeyslpMaP6 InCtO24oZbbkNMSp0B4lue7hhjl1E8ETiWN/4u1TheSEvnLZv3YFSE+yddIQRaXx6pau px/DnBzXDGW4z40tlF6EVOb4YuBXZO1K20Fk56kuDZ7yYjM3mT2S9b5xNARhO2aRSLlQ F5fiXMi+YpqvxzKSKJMiaiKNtUyF9C8r02FRAEQF8Q8ow/yLnpHt7GUyAWOq0XwBGBnE TQwqB/T68TAhl7eC3gY+ziF77zKVfvWP1b09Vkem54RchNoQ2qp6IS/HzR1WbXVIUqVu Blzw== 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=FmslBRqsYlWJhsiCvsBQOFzYvBn8zFzaCsASqLn/a8E=; b=vOgTDaH3UN/YevCNa3lUQzHQYUPUQ5o77RrJpc4pGIL53NegTIlyFoMPM4b0b+I1xL w8A+trVv2kh+Aa69i6O9w0psFPNNwDywEuVyCRM+xCqH/TZAEI0f3hj9H4L+nvjIbWxy hTfK9dBN3AEqntRRRsBssO41n361MWrVOiqMpUKBtPwit9FvOtnbLdjcO8Arf2RhchCH M6QJre0vRlwAGAYv8DKiTxZQkkDptpxI8AFouz5Sllc7Bx2tmqc7pp/7xBSGnM1athD0 otpJO0/ywLTFFUvyB9wnj10uBntktWra2QOrveWm0Z0gK6NhqEOXb1PfI2O7UgrDSaoO 5L5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cqYhKdzF; 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 a6si21103060pfa.227.2018.12.06.02.05.25; Thu, 06 Dec 2018 02:05:41 -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=cqYhKdzF; 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 S1729315AbeLFKEI (ORCPT + 99 others); Thu, 6 Dec 2018 05:04:08 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:42588 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727575AbeLFKEH (ORCPT ); Thu, 6 Dec 2018 05:04:07 -0500 Received: by mail-ed1-f68.google.com with SMTP id j6so243245edp.9 for ; Thu, 06 Dec 2018 02:04:06 -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=FmslBRqsYlWJhsiCvsBQOFzYvBn8zFzaCsASqLn/a8E=; b=cqYhKdzFEGjeyougx7dV6pe0LBdjFNb5glrs21mqBRVUaCra7fp9Y8muFrEB8vmvSU wBDeHDQcEvny1SmHaM9ZODEb5CvAONC3OtoU3FRyg70zMdYB3Fs4j7VqAA+cBumgAni0 mIASSqvIoUEPxzHtyMcF9hd88yau9XEUAMept0jZsJ1Z1N1ilg1XrdhpCxew6s0E6+xm mJTficlLkhgEER8d7YgnZiaIZ5KQMywm1Z4toPVhv6v4rKE5aJyXYGEHvIm4Qg7v+ijJ j6lqytpKkyhpiWRuUeOZP8lnu7kOsyhmCIU6F/I/l7r+CnUutXTZYrKFaznJcToWMMly QvmQ== 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=FmslBRqsYlWJhsiCvsBQOFzYvBn8zFzaCsASqLn/a8E=; b=fWuxPrSjQNXGYEB05UZxXdv1TA1KpSRGG5Qp1W508gNJ6COq5mhqW/iP7cVdgdwpJ6 62cu0ltK6hB/RKgdDEku6GguVFtdjT7qbls/L7OWCvILeCRiNIJpZKFsffFH5S4v2B2d iA8QWzcQt0Z/iYxFc1bMU92K/knKXqrzOykyKqZIQzL7HCYEUzj7kEsZs02MTh5e5O5q fRBMRaZVFCEzpcUkvmD9GIiG2BIUNBwBEo5Nkzllw4qaQGUEyHN3lurgaFJKbFcRROli RGDBwi7TaEyRHU2Joyz0V61/4JoHLnw/ZLRN5JrQ6SREaR435bi8ZLV6Niqiz/ovWHqZ 7H2g== X-Gm-Message-State: AA+aEWZIzvuK3QMNa+pf7959zmMkNfHX2OMQI3qDRoK8UT2ZVAPZNanP llAQ8Ls6gob906R1G/RkgVCuy3cqERK/70vauw== X-Received: by 2002:a17:906:d054:: with SMTP id bo20-v6mr1368741ejb.239.1544090645721; Thu, 06 Dec 2018 02:04:05 -0800 (PST) MIME-Version: 1.0 References: <1543892757-4323-1-git-send-email-kernelfans@gmail.com> <20181204072251.GT31738@dhcp22.suse.cz> <20181204085601.GC1286@dhcp22.suse.cz> <20181205092148.GA1286@dhcp22.suse.cz> <186b1804-3b1e-340e-f73b-f3c7e69649f5@suse.cz> <20181206082806.GB1286@dhcp22.suse.cz> In-Reply-To: <20181206082806.GB1286@dhcp22.suse.cz> From: Pingfan Liu Date: Thu, 6 Dec 2018 18:03:53 +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 [...] > THanks for pointing this out. It made my life easier. So It think the > bug is that we call init_memory_less_node from this path. I suspect > numa_register_memblks is the right place to do this. So I admit I > am not 100% sure but could you give this a try please? > Sure. > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c > index 1308f5408bf7..4575ae4d5449 100644 > --- a/arch/x86/mm/numa.c > +++ b/arch/x86/mm/numa.c > @@ -527,6 +527,19 @@ static void __init numa_clear_kernel_node_hotplug(void) > } > } > > +static void __init init_memory_less_node(int nid) > +{ > + unsigned long zones_size[MAX_NR_ZONES] = {0}; > + unsigned long zholes_size[MAX_NR_ZONES] = {0}; > + > + free_area_init_node(nid, zones_size, 0, zholes_size); > + > + /* > + * All zonelists will be built later in start_kernel() after per cpu > + * areas are initialized. > + */ > +} > + > static int __init numa_register_memblks(struct numa_meminfo *mi) > { > unsigned long uninitialized_var(pfn_align); > @@ -592,6 +605,8 @@ static int __init numa_register_memblks(struct numa_meminfo *mi) > continue; > > alloc_node_data(nid); > + if (!end) > + init_memory_less_node(nid); > } > > /* Dump memblock with node info and return. */ > @@ -721,21 +736,6 @@ void __init x86_numa_init(void) > numa_init(dummy_numa_init); > } > > -static void __init init_memory_less_node(int nid) > -{ > - unsigned long zones_size[MAX_NR_ZONES] = {0}; > - unsigned long zholes_size[MAX_NR_ZONES] = {0}; > - > - /* Allocate and initialize node data. Memory-less node is now online.*/ > - alloc_node_data(nid); > - free_area_init_node(nid, zones_size, 0, zholes_size); > - > - /* > - * All zonelists will be built later in start_kernel() after per cpu > - * areas are initialized. > - */ > -} > - > /* > * Setup early cpu_to_node. > * > @@ -763,9 +763,6 @@ void __init init_cpu_to_node(void) > if (node == NUMA_NO_NODE) > continue; > > - if (!node_online(node)) > - init_memory_less_node(node); > - > numa_set_node(cpu, node); > } > } > -- Which commit is this patch applied on? I can not apply it on latest linux tree. Thanks, Pingfan