Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2868048ybi; Thu, 4 Jul 2019 21:18:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJqahQ0Ma4Grln2ZlrkXychXoCNpIoRmamCu3d1/4yra+21BHCD+1118ZEHesf00PZ5wBS X-Received: by 2002:a63:5c15:: with SMTP id q21mr2400162pgb.248.1562300309580; Thu, 04 Jul 2019 21:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562300309; cv=none; d=google.com; s=arc-20160816; b=DLyxqORqRF1lf4VFp5rkjCM1uZDWBkyACK4KnGcjr2xOqES6DDetL177wJFMuPBsVm bp5zUoByZaYIjwdNPOTFImwu+2wOG6epK1urFMpVuE8Izmm+vqbB3TaS6Q8DaWpH+Hba 2GLuUPD08M6xABv3YcsYdNMpgSBZivg8cr+fqUKgl/bp7qIkcSoGDRm8KjQHdGMP5jh1 B+5GWLvvDdPaigvTlr5wWDXIDuiUvBoJrjeyCjbo9YMjgNbpp7ald7Um+AZVfEeCt3Z0 n1/OchxvZvKXLIag7gj/sp0RkPA3hJnpE1T8HL5zzBb2BgsWtLuXEk6VV8ji6al7ngQi tX9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=DIVzl05bCmHqAQSTOF3kZ/Ym5AufpX9dq9JbDFqM6xA=; b=UA7a1mPS8j1JgKJYysK/afOGFRZX6hGv7vD400cfSVJek6gbpamxlXzAX3dkaVJsgz c57w3pi/4JKKyQVWdWSc3Ew1RLALn3kzxQbJMaUTHH3WG83gfzVNJS93vGXFgIlOzbhI po0G47qhM2/16POa9AifpRI2FihXB3zzGRwF3GUQCoYN+Y9F4ikLT6xix8lmr1JO2j0E 0D+KElrdcj6QEhJiEngM3oXR8ygNZHqsrhwzH3MM9/SSyqFKt7RIuextwrR0lF0hcLeD W3LZL5yH+rRZZkL3Xiry+hCub/5RH3nlroZ9F1J8yQnrD043Xa3iGwX72iOz75EyVv+e aPUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=irbfu9qA; 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 f89si7232028pje.50.2019.07.04.21.18.13; Thu, 04 Jul 2019 21:18:29 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=irbfu9qA; 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 S1725827AbfGEEQ3 (ORCPT + 99 others); Fri, 5 Jul 2019 00:16:29 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36645 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725280AbfGEEQ3 (ORCPT ); Fri, 5 Jul 2019 00:16:29 -0400 Received: by mail-pl1-f196.google.com with SMTP id k8so3970836plt.3 for ; Thu, 04 Jul 2019 21:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=DIVzl05bCmHqAQSTOF3kZ/Ym5AufpX9dq9JbDFqM6xA=; b=irbfu9qArbablvA6nbNLTjhMKotjU5R09Zqx9DqYYzjYZz6fd5+MPt/5WZbfkukptH ModvZovWGiIEr+b3EIj5ZiICW7ImUrh3nRwJTahq1LWKcCom1ky/dNd/YJtqmVepFxZ8 7AsjoiTxjhRx2Aj53GHp3t5fLh2hoojsAcpKPqb0LR381CH/haWPEyvmmHBz2cAivW99 WVXDORQ9Wr97G+nOp9RqBFcimlQK4ne9s+s2+ZgyW2brfU8QICXkVIuoj+gkRZdHXC3l ZmGrtQLaXCzMowk6ehabqxUsVefUs7+VLbWuol4DwWq9rU1zsWApq87yWvwdSTmkzzeM C6nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DIVzl05bCmHqAQSTOF3kZ/Ym5AufpX9dq9JbDFqM6xA=; b=IQIctZBsMjgqPoiU7jHN7/8ac3zJlDAe/wVGvfQj0F/woTjsbh/v89Lw0aOlM4YHcw LxpYFN5oVoLZ4X/2im6s00IFwbEK1rKvqO8gmEK3vx7AilMl+wNk753EFVZIdczqYXUm 4YHexrS0uc3ADG//2xcNUcqFau9KsZ7hfwFQklwxyr1Ruy0MVFTtupFB+9Jzi0yzv04t npU1qAgXaoUiX8CChOhtF/vK9isg3nQRHMAzXu9SMHDUvFBP43OmyTXc8PVmprHDL/wt oHqqCzqrEGa+6VKbRvr4tmcrQdT1d1Ebp2aLC+FvCdNk/2sadgNXogsnqDQhuJZsQl/j Yvjw== X-Gm-Message-State: APjAAAXiSU2uSb7Vwyns9ba85AbOv5ak5TbtTA+yzmIiM0ucLGnrZgsW IZHSr7CoCt7tTaQm4TBUpA== X-Received: by 2002:a17:902:f204:: with SMTP id gn4mr2206522plb.3.1562300188420; Thu, 04 Jul 2019 21:16:28 -0700 (PDT) Received: from mylaptop.redhat.com ([2408:8207:7821:9e80:eaf2:5f81:4c66:c3d0]) by smtp.gmail.com with ESMTPSA id l68sm16328638pjb.8.2019.07.04.21.16.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jul 2019 21:16:27 -0700 (PDT) From: Pingfan Liu To: x86@kernel.org Cc: Pingfan Liu , Michal Hocko , Dave Hansen , Mike Rapoport , Tony Luck , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrew Morton , Vlastimil Babka , Oscar Salvador , Pavel Tatashin , Mel Gorman , Benjamin Herrenschmidt , Michael Ellerman , Stephen Rothwell , Qian Cai , Barret Rhoden , Bjorn Helgaas , David Rientjes , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] x86/numa: carve node online semantics out of alloc_node_data() Date: Fri, 5 Jul 2019 12:15:42 +0800 Message-Id: <1562300143-11671-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Node online means either memory online or cpu online. But there is requirement to instance a pglist_data, which has neither cpu nor memory online (refer to [2/2]). So carve out the online semantics, and call node_set_online() where either memory or cpu is online. Signed-off-by: Pingfan Liu Cc: Michal Hocko Cc: Dave Hansen Cc: Mike Rapoport Cc: Tony Luck Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Andrew Morton Cc: Michal Hocko Cc: Vlastimil Babka Cc: Oscar Salvador Cc: Pavel Tatashin Cc: Mel Gorman Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Stephen Rothwell Cc: Qian Cai Cc: Barret Rhoden Cc: Bjorn Helgaas Cc: David Rientjes Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- arch/x86/mm/numa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index e6dad60..b48d507 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -213,8 +213,6 @@ static void __init alloc_node_data(int nid) node_data[nid] = nd; memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); - - node_set_online(nid); } /** @@ -589,6 +587,7 @@ static int __init numa_register_memblks(struct numa_meminfo *mi) continue; alloc_node_data(nid); + node_set_online(nid); } /* Dump memblock with node info and return. */ @@ -760,8 +759,10 @@ void __init init_cpu_to_node(void) if (node == NUMA_NO_NODE) continue; - if (!node_online(node)) + if (!node_online(node)) { init_memory_less_node(node); + node_set_online(nid); + } numa_set_node(cpu, node); } -- 2.7.5