Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/numa: cleanup configuration dependent command-line options

Patch series "device-dax: Support sub-dividing soft-reserved ranges", v5.

The device-dax facility allows an address range to be directly mapped
through a chardev, or optionally hotplugged to the core kernel page
allocator as System-RAM. It is the mechanism for converting persistent
memory (pmem) to be used as another volatile memory pool i.e. the current
Memory Tiering hot topic on linux-mm.

In the case of pmem the nvdimm-namespace-label mechanism can sub-divide
it, but that labeling mechanism is not available / applicable to
soft-reserved ("EFI specific purpose") memory [3]. This series provides a
sysfs-mechanism for the daxctl utility to enable provisioning of
volatile-soft-reserved memory ranges.

The motivations for this facility are:

1/ Allow performance differentiated memory ranges to be split between
kernel-managed and directly-accessed use cases.

2/ Allow physical memory to be provisioned along performance relevant
address boundaries. For example, divide a memory-side cache [4] along
cache-color boundaries.

3/ Parcel out soft-reserved memory to VMs using device-dax as a security
/ permissions boundary [5]. Specifically I have seen people (ab)using
memmap=nn!ss (mark System-RAM as Persistent Memory) just to get the
device-dax interface on custom address ranges. A follow-on for the VM
use case is to teach device-dax to dynamically allocate 'struct page' at
runtime to reduce the duplication of 'struct page' space in both the
guest and the host kernel for the same physical pages.

[2]: http://lore.kernel.org/r/20200713160837.13774-11-joao.m.martins@oracle.com
[3]: http://lore.kernel.org/r/157309097008.1579826.12818463304589384434.stgit@dwillia2-desk3.amr.corp.intel.com
[4]: http://lore.kernel.org/r/154899811738.3165233.12325692939590944259.stgit@dwillia2-desk3.amr.corp.intel.com
[5]: http://lore.kernel.org/r/20200110190313.17144-1-joao.m.martins@oracle.com

This patch (of 23):

In preparation for adding a new numa= option clean up the existing ones to
avoid ifdefs in numa_setup(), and provide feedback when the option is
numa=fake= option is invalid due to kernel config. The same does not need
to be done for numa=noacpi, since the capability is already hard disabled
at compile-time.

Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brice Goglin <Brice.Goglin@inria.fr>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: David Airlie <airlied@linux.ie>
Cc: David Hildenbrand <david@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Jia He <justin.he@arm.com>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Hulk Robot <hulkci@huawei.com>
Cc: Jason Yan <yanaijie@huawei.com>
Cc: "Jérôme Glisse" <jglisse@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: kernel test robot <lkp@intel.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Link: https://lkml.kernel.org/r/160106109960.30709.7379926726669669398.stgit@dwillia2-desk3.amr.corp.intel.com
Link: https://lkml.kernel.org/r/159643094279.4062302.17779410714418721328.stgit@dwillia2-desk3.amr.corp.intel.com
Link: https://lkml.kernel.org/r/159643094925.4062302.14979872973043772305.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Dan Williams and committed by
Linus Torvalds
2dd57d34 1abbef4f

+24 -12
+7 -1
arch/x86/include/asm/numa.h
··· 3 3 #define _ASM_X86_NUMA_H 4 4 5 5 #include <linux/nodemask.h> 6 + #include <linux/errno.h> 6 7 7 8 #include <asm/topology.h> 8 9 #include <asm/apicdef.h> ··· 78 77 #ifdef CONFIG_NUMA_EMU 79 78 #define FAKE_NODE_MIN_SIZE ((u64)32 << 20) 80 79 #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) 81 - void numa_emu_cmdline(char *); 80 + int numa_emu_cmdline(char *str); 81 + #else /* CONFIG_NUMA_EMU */ 82 + static inline int numa_emu_cmdline(char *str) 83 + { 84 + return -EINVAL; 85 + } 82 86 #endif /* CONFIG_NUMA_EMU */ 83 87 84 88 #endif /* _ASM_X86_NUMA_H */
+2 -6
arch/x86/mm/numa.c
··· 37 37 return -EINVAL; 38 38 if (!strncmp(opt, "off", 3)) 39 39 numa_off = 1; 40 - #ifdef CONFIG_NUMA_EMU 41 40 if (!strncmp(opt, "fake=", 5)) 42 - numa_emu_cmdline(opt + 5); 43 - #endif 44 - #ifdef CONFIG_ACPI_NUMA 41 + return numa_emu_cmdline(opt + 5); 45 42 if (!strncmp(opt, "noacpi", 6)) 46 - acpi_numa = -1; 47 - #endif 43 + disable_srat(); 48 44 return 0; 49 45 } 50 46 early_param("numa", numa_setup);
+2 -1
arch/x86/mm/numa_emulation.c
··· 13 13 static int emu_nid_to_phys[MAX_NUMNODES]; 14 14 static char *emu_cmdline __initdata; 15 15 16 - void __init numa_emu_cmdline(char *str) 16 + int __init numa_emu_cmdline(char *str) 17 17 { 18 18 emu_cmdline = str; 19 + return 0; 19 20 } 20 21 21 22 static int __init emu_find_memblk_by_nid(int nid, const struct numa_meminfo *mi)
+1 -1
arch/x86/xen/enlighten_pv.c
··· 1300 1300 * any NUMA information the kernel tries to get from ACPI will 1301 1301 * be meaningless. Prevent it from trying. 1302 1302 */ 1303 - acpi_numa = -1; 1303 + disable_srat(); 1304 1304 #endif 1305 1305 WARN_ON(xen_cpuhp_setup(xen_cpu_up_prepare_pv, xen_cpu_dead_pv)); 1306 1306
+7 -2
drivers/acpi/numa/srat.c
··· 27 27 = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; 28 28 29 29 unsigned char acpi_srat_revision __initdata; 30 - int acpi_numa __initdata; 30 + static int acpi_numa __initdata; 31 + 32 + void __init disable_srat(void) 33 + { 34 + acpi_numa = -1; 35 + } 31 36 32 37 int pxm_to_node(int pxm) 33 38 { ··· 168 163 void __init bad_srat(void) 169 164 { 170 165 pr_err("SRAT: SRAT not used.\n"); 171 - acpi_numa = -1; 166 + disable_srat(); 172 167 } 173 168 174 169 int __init srat_disabled(void)
+5 -1
include/acpi/acpi_numa.h
··· 17 17 extern int node_to_pxm(int); 18 18 extern int acpi_map_pxm_to_node(int); 19 19 extern unsigned char acpi_srat_revision; 20 - extern int acpi_numa __initdata; 20 + extern void disable_srat(void); 21 21 22 22 extern void bad_srat(void); 23 23 extern int srat_disabled(void); 24 24 25 + #else /* CONFIG_ACPI_NUMA */ 26 + static inline void disable_srat(void) 27 + { 28 + } 25 29 #endif /* CONFIG_ACPI_NUMA */ 26 30 #endif /* __ACP_NUMA_H */