aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-10 15:07:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-10 15:07:22 -0500
commit264015f8a83fefc62c5125d761fbbadf924e520c (patch)
tree6a0602761abb3d866471861a7128a5177a855fd0
parentd55fc37856244c929965c190c8e9dcb49e2c07aa (diff)
parentab27a8d04b32b6ee8c30c14c4afd1058e8addc82 (diff)
Merge tag 'libnvdimm-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm updates from Dan Williams: "Outside of the new ACPI-NFIT hot-add support this pull request is more notable for what it does not contain, than what it does. There were a handful of development topics this cycle, dax get_user_pages, dax fsync, and raw block dax, that need more more iteration and will wait for 4.5. The patches to make devm and the pmem driver NUMA aware have been in -next for several weeks. The hot-add support has not, but is contained to the NFIT driver and is passing unit tests. The coredump support is straightforward and was looked over by Jeff. All of it has received a 0day build success notification across 107 configs. Summary: - Add support for the ACPI 6.0 NFIT hot add mechanism to process updates of the NFIT at runtime. - Teach the coredump implementation how to filter out DAX mappings. - Introduce NUMA hints for allocations made by the pmem driver, and as a side effect all devm allocations now hint their NUMA node by default" * tag 'libnvdimm-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: coredump: add DAX filtering for FDPIC ELF coredumps coredump: add DAX filtering for ELF coredumps acpi: nfit: Add support for hot-add nfit: in acpi_nfit_init, break on a 0-length table pmem, memremap: convert to numa aware allocations devm_memremap_pages: use numa_mem_id devm: make allocations numa aware by default devm_memremap: convert to return ERR_PTR devm_memunmap: use devres_release() pmem: kill memremap_pmem() x86, mm: quiet arch_add_memory()
-rw-r--r--Documentation/filesystems/proc.txt22
-rw-r--r--arch/x86/mm/init.c4
-rw-r--r--arch/x86/mm/init_64.c4
-rw-r--r--drivers/acpi/nfit.c298
-rw-r--r--drivers/acpi/nfit.h2
-rw-r--r--drivers/base/devres.c19
-rw-r--r--drivers/nvdimm/pmem.c28
-rw-r--r--fs/binfmt_elf.c10
-rw-r--r--fs/binfmt_elf_fdpic.c15
-rw-r--r--include/linux/device.h16
-rw-r--r--include/linux/pmem.h26
-rw-r--r--include/linux/sched.h4
-rw-r--r--kernel/memremap.c16
-rw-r--r--tools/testing/nvdimm/test/nfit.c164
14 files changed, 494 insertions, 134 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 1e4a6cc1b6ea..402ab99e409f 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1605,16 +1605,16 @@ Documentation/accounting.
1605--------------------------------------------------------------- 1605---------------------------------------------------------------
1606When a process is dumped, all anonymous memory is written to a core file as 1606When a process is dumped, all anonymous memory is written to a core file as
1607long as the size of the core file isn't limited. But sometimes we don't want 1607long as the size of the core file isn't limited. But sometimes we don't want
1608to dump some memory segments, for example, huge shared memory. Conversely, 1608to dump some memory segments, for example, huge shared memory or DAX.
1609sometimes we want to save file-backed memory segments into a core file, not 1609Conversely, sometimes we want to save file-backed memory segments into a core
1610only the individual files. 1610file, not only the individual files.
1611 1611
1612/proc/<pid>/coredump_filter allows you to customize which memory segments 1612/proc/<pid>/coredump_filter allows you to customize which memory segments
1613will be dumped when the <pid> process is dumped. coredump_filter is a bitmask 1613will be dumped when the <pid> process is dumped. coredump_filter is a bitmask
1614of memory types. If a bit of the bitmask is set, memory segments of the 1614of memory types. If a bit of the bitmask is set, memory segments of the
1615corresponding memory type are dumped, otherwise they are not dumped. 1615corresponding memory type are dumped, otherwise they are not dumped.
1616 1616
1617The following 7 memory types are supported: 1617The following 9 memory types are supported:
1618 - (bit 0) anonymous private memory 1618 - (bit 0) anonymous private memory
1619 - (bit 1) anonymous shared memory 1619 - (bit 1) anonymous shared memory
1620 - (bit 2) file-backed private memory 1620 - (bit 2) file-backed private memory
@@ -1623,20 +1623,22 @@ The following 7 memory types are supported:
1623 effective only if the bit 2 is cleared) 1623 effective only if the bit 2 is cleared)
1624 - (bit 5) hugetlb private memory 1624 - (bit 5) hugetlb private memory
1625 - (bit 6) hugetlb shared memory 1625 - (bit 6) hugetlb shared memory
1626 - (bit 7) DAX private memory
1627 - (bit 8) DAX shared memory
1626 1628
1627 Note that MMIO pages such as frame buffer are never dumped and vDSO pages 1629 Note that MMIO pages such as frame buffer are never dumped and vDSO pages
1628 are always dumped regardless of the bitmask status. 1630 are always dumped regardless of the bitmask status.
1629 1631
1630 Note bit 0-4 doesn't effect any hugetlb memory. hugetlb memory are only 1632 Note that bits 0-4 don't affect hugetlb or DAX memory. hugetlb memory is
1631 effected by bit 5-6. 1633 only affected by bit 5-6, and DAX is only affected by bits 7-8.
1632 1634
1633Default value of coredump_filter is 0x23; this means all anonymous memory 1635The default value of coredump_filter is 0x33; this means all anonymous memory
1634segments and hugetlb private memory are dumped. 1636segments, ELF header pages and hugetlb private memory are dumped.
1635 1637
1636If you don't want to dump all shared memory segments attached to pid 1234, 1638If you don't want to dump all shared memory segments attached to pid 1234,
1637write 0x21 to the process's proc file. 1639write 0x31 to the process's proc file.
1638 1640
1639 $ echo 0x21 > /proc/1234/coredump_filter 1641 $ echo 0x31 > /proc/1234/coredump_filter
1640 1642
1641When a new process is created, the process inherits the bitmask status from its 1643When a new process is created, the process inherits the bitmask status from its
1642parent. It is useful to set up coredump_filter before the program runs. 1644parent. It is useful to set up coredump_filter before the program runs.
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 1f37cb2b56a9..493f54172b4a 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -354,7 +354,7 @@ static int __meminit split_mem_range(struct map_range *mr, int nr_range,
354 } 354 }
355 355
356 for (i = 0; i < nr_range; i++) 356 for (i = 0; i < nr_range; i++)
357 printk(KERN_DEBUG " [mem %#010lx-%#010lx] page %s\n", 357 pr_debug(" [mem %#010lx-%#010lx] page %s\n",
358 mr[i].start, mr[i].end - 1, 358 mr[i].start, mr[i].end - 1,
359 page_size_string(&mr[i])); 359 page_size_string(&mr[i]));
360 360
@@ -401,7 +401,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
401 unsigned long ret = 0; 401 unsigned long ret = 0;
402 int nr_range, i; 402 int nr_range, i;
403 403
404 pr_info("init_memory_mapping: [mem %#010lx-%#010lx]\n", 404 pr_debug("init_memory_mapping: [mem %#010lx-%#010lx]\n",
405 start, end - 1); 405 start, end - 1);
406 406
407 memset(mr, 0, sizeof(mr)); 407 memset(mr, 0, sizeof(mr));
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 5ed62eff31bd..ec081fe0ce2c 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1270,7 +1270,7 @@ static int __meminit vmemmap_populate_hugepages(unsigned long start,
1270 /* check to see if we have contiguous blocks */ 1270 /* check to see if we have contiguous blocks */
1271 if (p_end != p || node_start != node) { 1271 if (p_end != p || node_start != node) {
1272 if (p_start) 1272 if (p_start)
1273 printk(KERN_DEBUG " [%lx-%lx] PMD -> [%p-%p] on node %d\n", 1273 pr_debug(" [%lx-%lx] PMD -> [%p-%p] on node %d\n",
1274 addr_start, addr_end-1, p_start, p_end-1, node_start); 1274 addr_start, addr_end-1, p_start, p_end-1, node_start);
1275 addr_start = addr; 1275 addr_start = addr;
1276 node_start = node; 1276 node_start = node;
@@ -1368,7 +1368,7 @@ void register_page_bootmem_memmap(unsigned long section_nr,
1368void __meminit vmemmap_populate_print_last(void) 1368void __meminit vmemmap_populate_print_last(void)
1369{ 1369{
1370 if (p_start) { 1370 if (p_start) {
1371 printk(KERN_DEBUG " [%lx-%lx] PMD -> [%p-%p] on node %d\n", 1371 pr_debug(" [%lx-%lx] PMD -> [%p-%p] on node %d\n",
1372 addr_start, addr_end-1, p_start, p_end-1, node_start); 1372 addr_start, addr_end-1, p_start, p_end-1, node_start);
1373 p_start = NULL; 1373 p_start = NULL;
1374 p_end = NULL; 1374 p_end = NULL;
diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 6e26761a27da..f7dab53b352a 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -33,6 +33,15 @@ static bool force_enable_dimms;
33module_param(force_enable_dimms, bool, S_IRUGO|S_IWUSR); 33module_param(force_enable_dimms, bool, S_IRUGO|S_IWUSR);
34MODULE_PARM_DESC(force_enable_dimms, "Ignore _STA (ACPI DIMM device) status"); 34MODULE_PARM_DESC(force_enable_dimms, "Ignore _STA (ACPI DIMM device) status");
35 35
36struct nfit_table_prev {
37 struct list_head spas;
38 struct list_head memdevs;
39 struct list_head dcrs;
40 struct list_head bdws;
41 struct list_head idts;
42 struct list_head flushes;
43};
44
36static u8 nfit_uuid[NFIT_UUID_MAX][16]; 45static u8 nfit_uuid[NFIT_UUID_MAX][16];
37 46
38const u8 *to_nfit_uuid(enum nfit_uuids id) 47const u8 *to_nfit_uuid(enum nfit_uuids id)
@@ -221,12 +230,20 @@ static int nfit_spa_type(struct acpi_nfit_system_address *spa)
221} 230}
222 231
223static bool add_spa(struct acpi_nfit_desc *acpi_desc, 232static bool add_spa(struct acpi_nfit_desc *acpi_desc,
233 struct nfit_table_prev *prev,
224 struct acpi_nfit_system_address *spa) 234 struct acpi_nfit_system_address *spa)
225{ 235{
226 struct device *dev = acpi_desc->dev; 236 struct device *dev = acpi_desc->dev;
227 struct nfit_spa *nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa), 237 struct nfit_spa *nfit_spa;
228 GFP_KERNEL); 238
239 list_for_each_entry(nfit_spa, &prev->spas, list) {
240 if (memcmp(nfit_spa->spa, spa, sizeof(*spa)) == 0) {
241 list_move_tail(&nfit_spa->list, &acpi_desc->spas);
242 return true;
243 }
244 }
229 245
246 nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa), GFP_KERNEL);
230 if (!nfit_spa) 247 if (!nfit_spa)
231 return false; 248 return false;
232 INIT_LIST_HEAD(&nfit_spa->list); 249 INIT_LIST_HEAD(&nfit_spa->list);
@@ -239,12 +256,19 @@ static bool add_spa(struct acpi_nfit_desc *acpi_desc,
239} 256}
240 257
241static bool add_memdev(struct acpi_nfit_desc *acpi_desc, 258static bool add_memdev(struct acpi_nfit_desc *acpi_desc,
259 struct nfit_table_prev *prev,
242 struct acpi_nfit_memory_map *memdev) 260 struct acpi_nfit_memory_map *memdev)
243{ 261{
244 struct device *dev = acpi_desc->dev; 262 struct device *dev = acpi_desc->dev;
245 struct nfit_memdev *nfit_memdev = devm_kzalloc(dev, 263 struct nfit_memdev *nfit_memdev;
246 sizeof(*nfit_memdev), GFP_KERNEL);
247 264