From patchwork Tue Jul 18 11:41:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Kilari X-Patchwork-Id: 9848089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4608960392 for ; Tue, 18 Jul 2017 11:45:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31750283C3 for ; Tue, 18 Jul 2017 11:45:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2614328497; Tue, 18 Jul 2017 11:45:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44465283C3 for ; Tue, 18 Jul 2017 11:45:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXQtz-0006f3-1F; Tue, 18 Jul 2017 11:42:55 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXQtx-0006d7-S8 for xen-devel@lists.xen.org; Tue, 18 Jul 2017 11:42:54 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id 45/BE-22472-D34FD695; Tue, 18 Jul 2017 11:42:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXiVRvsomvzJTf SYPEsXoslHxezODB6HN39mymAMYo1My8pvyKBNePBm8SCBQUVf9euZmlgfBTVxcjFISTQzyhx uPsBM4jDIvCSRWLmi6nsII6EQD+rxJ7zh5m6GDmBnDiJ/5t+sUDYlRITX89gA7GFBFQlOv6/Z YcY1cYkMfNALytIgk1ARuLI8wNgzSIC0hLXPl9mBCliFtjGJLHpOsgKTg5hAVeJ81v+gE1iAZ o0/eBCsAZeATeJy7O3ANkcQNsUJOZMsgEJcwKFF3VdYodY7Cpxo28l6wRGgQWMDKsY1YtTi8p Si3TN9JKKMtMzSnITM3N0DQ2M9XJTi4sT01NzEpOK9ZLzczcxAgOrnoGBcQfjlTbnQ4ySHExK oryrD+RGCvEl5adUZiQWZ8QXleakFh9ilOHgUJLgZfsMlBMsSk1PrUjLzAGGOExagoNHSYT3G Eiat7ggMbc4Mx0idYrRmGPSge1fmDheTfj/jUmIJS8/L1VKnFcUpFQApDSjNA9uECz2LjHKSg nzMjIwMAjxFKQW5WaWoMq/YhTnYFQS5l33CWgKT2ZeCdy+V0CnMAGdIuybA3JKSSJCSqqBMaj TUrJ3mu0DCZtinS/OHJxb00ILGNV2fLyr6lgzfZv8w/fa8iGVLT49Lmtb7yk+sQhq/Nx/QvWz v8yzV/8nBB/c1ia98abvm4ss/AY5xcE+c38ezLdwk0g8ZnX7GGdDS4OHyuYXXEfW6+68vnJl0 6LyVy83lUv98qgTtrbZsn9iUpiCOoObEktxRqKhFnNRcSIAwd+6tLgCAAA= X-Env-Sender: vijay.kilari@gmail.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1500378170!102732234!1 X-Originating-IP: [74.125.83.68] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26925 invoked from network); 18 Jul 2017 11:42:51 -0000 Received: from mail-pg0-f68.google.com (HELO mail-pg0-f68.google.com) (74.125.83.68) by server-5.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Jul 2017 11:42:51 -0000 Received: by mail-pg0-f68.google.com with SMTP id z1so2550586pgs.0 for ; Tue, 18 Jul 2017 04:42:51 -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:in-reply-to:references; bh=Hj/sDhsAUq1fFm95YdLGHqhNuaKSWWW2fFxR0H9aWHw=; b=QQ2OefoL6JUp9yXTe5l2woO6TnmxSCz2CT5eRmUHcJiVYbh6lLesKceMevcSEnT+MF o8XIfPpaGPLQyj3KbdxOE8iUStXa3XPcx9zkdI3kXWBNc/4i1Fr+LJvQgTFyJGxyIMxD AYCInVSB5p43TEdy0dpI6RYHjrfpYI7poeIKqAtKVX6CiM7OuT1j4xItCdZZlg8b6irZ MUmbiJLSO3gk5BRMGTgL8FVaJmKeqv5jW0+KpQhA1V7C3U29M7JMZSDQNWQwci5cfLR4 blDFPR8LvKr+eevwtMaGrNgfmZp9B4KEUgbQhhEa3tI3sGzV2/xUmQ6JlyRwEaEKq18k wqRg== 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:in-reply-to :references; bh=Hj/sDhsAUq1fFm95YdLGHqhNuaKSWWW2fFxR0H9aWHw=; b=WpZ3Oxw6hxxhJy+BmCdVs8sFZXAe3Hl6vq8dqUMaqE7LvV49rDymJmoCsufRIBBSGm bquKymAoBKFCtho01MFRrtTtlYpujSyJ4BKWgC3iel3UbD89I9kL4UfC59pgxo2YkHdy fMtoiz9OtTVIs4C9I7gUOSALkPdGIG+MUnaZ2+1JrxFMfGWLxg0DiaXIZ8QA8U3XrAV+ /2d9nGRmqKJe/FoaktoBhnIlLz7CwIijXd7cMjEfBJEvPV0sKQ88BE+gsTQcRA765sib PrJysGp0Fd/CW4tkJAuuj0oAl5R+apA4YZgFIpsCP3R/9nouTeyIwl5VVNoFIeb8cM55 32kQ== X-Gm-Message-State: AIVw112SqlL76lsbwi3u7BJdv0Pff+Z+oEjWKBqa/h8ECgMXkB9vMW49 q0CTjjGWwcvA11G7 X-Received: by 10.84.178.37 with SMTP id y34mr1219437plb.223.1500378170062; Tue, 18 Jul 2017 04:42:50 -0700 (PDT) Received: from cavium-Vostro-2520.caveonetworks.com ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id r27sm4879707pfe.0.2017.07.18.04.42.46 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Jul 2017 04:42:49 -0700 (PDT) From: vijay.kilari@gmail.com To: xen-devel@lists.xen.org Date: Tue, 18 Jul 2017 17:11:31 +0530 Message-Id: <1500378106-2620-10-git-send-email-vijay.kilari@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1500378106-2620-1-git-send-email-vijay.kilari@gmail.com> References: <1500378106-2620-1-git-send-email-vijay.kilari@gmail.com> Cc: kevin.tian@intel.com, sstabellini@kernel.org, wei.liu2@citrix.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, julien.grall@arm.com, jbeulich@suse.com, Vijaya Kumar K Subject: [Xen-devel] [RFC PATCH v3 09/24] NUMA: x86: Move common code from srat.c X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Vijaya Kumar K Move code from xen/arch/x86/srat.c to xen/common/numa.c so that it can be used by other archs. Apart from moving the code the following changes are done - Coding style of code moved to numa.c is changed to xen style - {memory,processor}_nodes_parsed are made global and moved to xen/nodemask.h - Few generic static functions in x86/srat.c are made non-static - Functions moved from x85/srat.c to common/numa.c are made non-static - numa_scan_nodes() is made as static function - compute_memnode_shift() and setup_node_bootmem() are made static. Also {memory,processor}_nodes_parsed are made as global. These are used across multiple code files. Adding helpers to access these nodemask_t is complex. Signed-off-by: Vijaya Kumar K --- v3: - Move declaration of {memory,processor}_nodes_parsed to header file - Drop redundant get_memblk() declaration - numa_scan_nodes(), setup_node_bootmem(), compute_memnode_shift() are made as static function --- xen/arch/x86/srat.c | 151 +---------------------------------------- xen/common/numa.c | 165 +++++++++++++++++++++++++++++++++++++++++++-- xen/include/asm-x86/acpi.h | 2 - xen/include/asm-x86/numa.h | 2 - xen/include/xen/nodemask.h | 2 + xen/include/xen/numa.h | 13 ++-- 6 files changed, 174 insertions(+), 161 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 03bc37d..be2634a 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -23,10 +23,6 @@ static struct acpi_table_slit *__read_mostly acpi_slit; -static nodemask_t __initdata memory_nodes_parsed; -static nodemask_t __initdata processor_nodes_parsed; -static struct node __initdata nodes[MAX_NUMNODES]; - struct pxm2node { unsigned int pxm; nodeid_t node; @@ -36,49 +32,8 @@ static struct pxm2node __read_mostly pxm2node[MAX_NUMNODES] = static unsigned int node_to_pxm(nodeid_t n); -static int num_node_memblks; -static struct node node_memblk_range[NR_NODE_MEMBLKS]; -static nodeid_t memblk_nodeid[NR_NODE_MEMBLKS]; static __initdata DECLARE_BITMAP(memblk_hotplug, NR_NODE_MEMBLKS); -static struct node *get_numa_node(unsigned int id) -{ - return &nodes[id]; -} - -static nodeid_t get_memblk_nodeid(unsigned int id) -{ - return memblk_nodeid[id]; -} - -static nodeid_t *get_memblk_nodeid_map(void) -{ - return &memblk_nodeid[0]; -} - -static struct node *get_node_memblk_range(unsigned int memblk) -{ - return &node_memblk_range[memblk]; -} - -static int get_num_node_memblks(void) -{ - return num_node_memblks; -} - -static int __init numa_add_memblk(nodeid_t nodeid, paddr_t start, uint64_t size) -{ - if (nodeid >= NR_NODE_MEMBLKS) - return -EINVAL; - - node_memblk_range[num_node_memblks].start = start; - node_memblk_range[num_node_memblks].end = start + size; - memblk_nodeid[num_node_memblks] = nodeid; - num_node_memblks++; - - return 0; -} - static inline bool node_found(unsigned int idx, unsigned int pxm) { return ((pxm2node[idx].pxm == pxm) && @@ -149,54 +104,7 @@ nodeid_t acpi_setup_node(unsigned int pxm) return node; } -int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node) -{ - int i; - - for (i = 0; i < get_num_node_memblks(); i++) { - struct node *nd = get_node_memblk_range(i); - - if (nd->start <= start && nd->end > end && - get_memblk_nodeid(i) == node) - return 1; - } - - return 0; -} - -static int __init conflicting_memblks(paddr_t start, paddr_t end) -{ - int i; - - for (i = 0; i < get_num_node_memblks(); i++) { - struct node *nd = get_node_memblk_range(i); - if (nd->start == nd->end) - continue; - if (nd->end > start && nd->start < end) - return i; - if (nd->end == end && nd->start == start) - return i; - } - return -1; -} - -static void __init cutoff_node(nodeid_t i, paddr_t start, paddr_t end) -{ - struct node *nd = get_numa_node(i); - - if (nd->start < start) { - nd->start = start; - if (nd->end < nd->start) - nd->start = nd->end; - } - if (nd->end > end) { - nd->end = end; - if (nd->start > nd->end) - nd->start = nd->end; - } -} - -static void __init numa_failed(void) +void __init numa_failed(void) { int i; printk(KERN_ERR "SRAT: SRAT not used.\n"); @@ -412,7 +320,7 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) /* Sanity check to catch more bad SRATs (they are amazingly common). Make sure the PXMs cover all memory. */ -static bool __init arch_sanitize_nodes_memory(void) +bool __init arch_sanitize_nodes_memory(void) { int i; @@ -509,61 +417,6 @@ void __init srat_parse_regions(paddr_t addr) pfn_pdx_hole_setup(mask >> PAGE_SHIFT); } -/* Use the information discovered above to actually set up the nodes. */ -int __init numa_scan_nodes(paddr_t start, paddr_t end) -{ - unsigned int i; - nodemask_t all_nodes_parsed; - struct node *memblks; - nodeid_t *nodeids; - - /* First clean up the node list */ - for (i = 0; i < MAX_NUMNODES; i++) - cutoff_node(i, start, end); - - if (acpi_numa <= 0) - return -1; - - if (!arch_sanitize_nodes_memory()) { - numa_failed(); - return -1; - } - - memblks = get_node_memblk_range(0); - nodeids = get_memblk_nodeid_map(); - if (compute_memnode_shift(node_memblk_range, num_node_memblks, - memblk_nodeid)) { - memnode_shift = 0; - printk(KERN_ERR - "SRAT: No NUMA node hash function found. Contact maintainer\n"); - numa_failed(); - return -1; - } - - nodes_or(all_nodes_parsed, memory_nodes_parsed, processor_nodes_parsed); - - /* Finally register nodes */ - for_each_node_mask(i, all_nodes_parsed) - { - struct node *nd = get_numa_node(i); - uint64_t size = nd->end - nd->start; - - if ( size == 0 ) - printk(KERN_WARNING "SRAT: Node %u has no memory. " - "BIOS Bug or mis-configured hardware?\n", i); - - setup_node_bootmem(i, nd->start, nd->end); - } - for (i = 0; i < nr_cpu_ids; i++) { - if (cpu_to_node[i] == NUMA_NO_NODE) - continue; - if (!node_isset(cpu_to_node[i], processor_nodes_parsed)) - numa_set_node(i, NUMA_NO_NODE); - } - numa_init_array(); - return 0; -} - static unsigned int node_to_pxm(nodeid_t n) { unsigned int i; diff --git a/xen/common/numa.c b/xen/common/numa.c index 0381f1b..74c4697 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -54,12 +54,109 @@ cpumask_t __read_mostly node_to_cpumask[MAX_NUMNODES]; bool numa_off; s8 acpi_numa = 0; +nodemask_t __initdata memory_nodes_parsed; +nodemask_t __initdata processor_nodes_parsed; +static struct node __initdata nodes[MAX_NUMNODES]; +static int num_node_memblks; +static struct node node_memblk_range[NR_NODE_MEMBLKS]; +static nodeid_t memblk_nodeid[NR_NODE_MEMBLKS]; int srat_disabled(void) { return numa_off || acpi_numa < 0; } +struct node *get_numa_node(unsigned int id) +{ + return &nodes[id]; +} + +nodeid_t get_memblk_nodeid(unsigned int id) +{ + return memblk_nodeid[id]; +} + +static nodeid_t *get_memblk_nodeid_map(void) +{ + return &memblk_nodeid[0]; +} + +struct node *get_node_memblk_range(unsigned int memblk) +{ + return &node_memblk_range[memblk]; +} + +int get_num_node_memblks(void) +{ + return num_node_memblks; +} + +int __init numa_add_memblk(nodeid_t nodeid, paddr_t start, uint64_t size) +{ + if ( nodeid >= NR_NODE_MEMBLKS ) + return -EINVAL; + + node_memblk_range[num_node_memblks].start = start; + node_memblk_range[num_node_memblks].end = start + size; + memblk_nodeid[num_node_memblks] = nodeid; + num_node_memblks++; + + return 0; +} + +int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node) +{ + int i; + + for ( i = 0; i < get_num_node_memblks(); i++ ) + { + struct node *nd = get_node_memblk_range(i); + + if ( nd->start <= start && nd->end > end && + get_memblk_nodeid(i) == node ) + return 1; + } + + return 0; +} + +int __init conflicting_memblks(paddr_t start, paddr_t end) +{ + int i; + + for ( i = 0; i < get_num_node_memblks(); i++ ) + { + struct node *nd = get_node_memblk_range(i); + + if ( nd->start == nd->end ) + continue; + if ( nd->end > start && nd->start < end ) + return i; + if ( nd->end == end && nd->start == start ) + return i; + } + + return -1; +} + +static void __init cutoff_node(nodeid_t i, paddr_t start, paddr_t end) +{ + struct node *nd = get_numa_node(i); + + if ( nd->start < start ) + { + nd->start = start; + if ( nd->end < nd->start ) + nd->start = nd->end; + } + if ( nd->end > end ) + { + nd->end = end; + if ( nd->start > nd->end ) + nd->start = nd->end; + } +} + /* * Given a shift value, try to populate memnodemap[] * Returns : @@ -154,8 +251,8 @@ static unsigned int __init extract_lsb_from_nodes(const struct node *nodes, return i; } -int __init compute_memnode_shift(struct node *nodes, unsigned int numnodes, - nodeid_t *nodeids) +static int __init compute_memnode_shift(struct node *nodes, unsigned int numnodes, + nodeid_t *nodeids) { int ret; @@ -180,7 +277,8 @@ int __init compute_memnode_shift(struct node *nodes, unsigned int numnodes, return 0; } /* initialize NODE_DATA given nodeid and start/end */ -void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end) +static void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, + paddr_t end) { unsigned long start_pfn, end_pfn; @@ -193,7 +291,7 @@ void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end) node_set_online(nodeid); } -void __init numa_init_array(void) +static void __init numa_init_array(void) { int rr, i; @@ -214,6 +312,65 @@ void __init numa_init_array(void) } } +/* Use the information discovered above to actually set up the nodes. */ +static int __init numa_scan_nodes(paddr_t start, paddr_t end) +{ + unsigned int i; + nodemask_t all_nodes_parsed; + struct node *memblks; + nodeid_t *nodeids; + + /* First clean up the node list */ + for ( i = 0; i < MAX_NUMNODES; i++ ) + cutoff_node(i, start, end); + + if ( acpi_numa <= 0 ) + return -1; + + if ( !arch_sanitize_nodes_memory() ) + { + numa_failed(); + return -1; + } + + memblks = get_node_memblk_range(0); + nodeids = get_memblk_nodeid_map(); + if ( compute_memnode_shift(node_memblk_range, num_node_memblks, + memblk_nodeid) ) + { + memnode_shift = 0; + printk(KERN_ERR + "SRAT: No NUMA node hash function found. Contact maintainer\n"); + numa_failed(); + return -1; + } + + nodes_or(all_nodes_parsed, memory_nodes_parsed, processor_nodes_parsed); + + /* Finally register nodes */ + for_each_node_mask(i, all_nodes_parsed) + { + struct node *nd = get_numa_node(i); + uint64_t size = nd->end - nd->start; + + if ( size == 0 ) + printk(KERN_WARNING "SRAT: Node %u has no memory. " + "BIOS Bug or mis-configured hardware?\n", i); + + setup_node_bootmem(i, nd->start, nd->end); + } + + for ( i = 0; i < nr_cpu_ids; i++ ) + { + if (cpu_to_node[i] == NUMA_NO_NODE) + continue; + if (!node_isset(cpu_to_node[i], processor_nodes_parsed)) + numa_set_node(i, NUMA_NO_NODE); + } + numa_init_array(); + return 0; +} + #ifdef CONFIG_NUMA_EMU static unsigned int __initdata numa_fake; diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h index a65c85f..59c34e7 100644 --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -103,8 +103,6 @@ extern void acpi_reserve_bootmem(void); #define ARCH_HAS_POWER_INIT 1 -extern int numa_scan_nodes(paddr_t start, paddr_t end); - #ifdef CONFIG_ACPI_SLEEP extern struct acpi_sleep_info acpi_sinfo; diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 41bb3ef..d8a0a44 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -17,8 +17,6 @@ extern void srat_detect_node(int cpu); extern nodeid_t apicid_to_node[]; extern void init_cpu_to_node(void); -extern int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node); - void srat_parse_regions(paddr_t addr); extern uint8_t __node_distance(nodeid_t a, nodeid_t b); unsigned int arch_get_dma_bitsize(void); diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index 2a90dc1..c52c110 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -80,6 +80,8 @@ typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; extern nodemask_t _unused_nodemask_arg_; +extern nodemask_t processor_nodes_parsed; +extern nodemask_t memory_nodes_parsed; #define node_set(node, dst) __node_set((node), &(dst)) static inline void __node_set(int node, volatile nodemask_t *dstp) diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index c6bbbdf..110d5dc 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -26,11 +26,8 @@ extern bool numa_off; extern s8 acpi_numa; void numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn); -int compute_memnode_shift(struct node *nodes, unsigned int numnodes, - nodeid_t *nodeids); int srat_disabled(void); -void numa_init_array(void); -void setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end); +int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node); #ifdef CONFIG_NUMA #define cpu_to_node(cpu) (cpu_to_node[cpu]) @@ -65,6 +62,14 @@ static inline __attribute_pure__ nodeid_t phys_to_nid(paddr_t addr) void numa_add_cpu(int cpu); void numa_set_node(int cpu, nodeid_t node); +int conflicting_memblks(paddr_t start, paddr_t end); +struct node *get_numa_node(unsigned int id); +nodeid_t get_memblk_nodeid(unsigned int memblk); +struct node *get_node_memblk_range(unsigned int memblk); +int numa_add_memblk(nodeid_t nodeid, paddr_t start, uint64_t size); +int get_num_node_memblks(void); +bool arch_sanitize_nodes_memory(void); +void numa_failed(void); #else static inline void numa_add_cpu(int cpu) { } static inline void numa_set_node(int cpu, nodeid_t node) { }