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.

Merge tag 'dax-fixes-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull dax fixes from Dan Williams:
"A few bug fixes around the handling of "Soft Reserved" memory and
memory tiering information.

Linux is starting to enounter more real world systems that deploy an
ACPI HMAT to describe different performance classes of memory, as well
the "special purpose" (Linux "Soft Reserved") designation from EFI.

These fixes result from that testing.

It has all appeared in -next for a while with no known issues.

- Fix duplicate overlapping device-dax instances for HMAT described
"Soft Reserved" Memory

- Fix missing node targets in the sysfs representation of memory
tiers

- Remove a confusing variable initialization"

* tag 'dax-fixes-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
device-dax: Fix duplicate 'hmem' device registration
ACPI: HMAT: Fix initiator registration for single-initiator systems
ACPI: HMAT: remove unnecessary variable initialization

+35 -16
+20 -7
drivers/acpi/numa/hmat.c
··· 562 562 { 563 563 struct memory_initiator *ia; 564 564 struct memory_initiator *ib; 565 - unsigned long *p_nodes = priv; 566 565 567 566 ia = list_entry(a, struct memory_initiator, node); 568 567 ib = list_entry(b, struct memory_initiator, node); 569 568 570 - set_bit(ia->processor_pxm, p_nodes); 571 - set_bit(ib->processor_pxm, p_nodes); 572 - 573 569 return ia->processor_pxm - ib->processor_pxm; 570 + } 571 + 572 + static int initiators_to_nodemask(unsigned long *p_nodes) 573 + { 574 + struct memory_initiator *initiator; 575 + 576 + if (list_empty(&initiators)) 577 + return -ENXIO; 578 + 579 + list_for_each_entry(initiator, &initiators, node) 580 + set_bit(initiator->processor_pxm, p_nodes); 581 + 582 + return 0; 574 583 } 575 584 576 585 static void hmat_register_target_initiators(struct memory_target *target) ··· 618 609 * initiators. 619 610 */ 620 611 bitmap_zero(p_nodes, MAX_NUMNODES); 621 - list_sort(p_nodes, &initiators, initiator_cmp); 612 + list_sort(NULL, &initiators, initiator_cmp); 613 + if (initiators_to_nodemask(p_nodes) < 0) 614 + return; 615 + 622 616 if (!access0done) { 623 617 for (i = WRITE_LATENCY; i <= READ_BANDWIDTH; i++) { 624 618 loc = localities_types[i]; ··· 655 643 656 644 /* Access 1 ignores Generic Initiators */ 657 645 bitmap_zero(p_nodes, MAX_NUMNODES); 658 - list_sort(p_nodes, &initiators, initiator_cmp); 659 - best = 0; 646 + if (initiators_to_nodemask(p_nodes) < 0) 647 + return; 648 + 660 649 for (i = WRITE_LATENCY; i <= READ_BANDWIDTH; i++) { 661 650 loc = localities_types[i]; 662 651 if (!loc)
+15 -9
drivers/dax/hmem/device.c
··· 8 8 static bool nohmem; 9 9 module_param_named(disable, nohmem, bool, 0444); 10 10 11 + static struct resource hmem_active = { 12 + .name = "HMEM devices", 13 + .start = 0, 14 + .end = -1, 15 + .flags = IORESOURCE_MEM, 16 + }; 17 + 11 18 void hmem_register_device(int target_nid, struct resource *r) 12 19 { 13 20 /* define a clean / non-busy resource for the platform device */ ··· 48 41 goto out_pdev; 49 42 } 50 43 44 + if (!__request_region(&hmem_active, res.start, resource_size(&res), 45 + dev_name(&pdev->dev), 0)) { 46 + dev_dbg(&pdev->dev, "hmem range %pr already active\n", &res); 47 + goto out_active; 48 + } 49 + 51 50 pdev->dev.numa_node = numa_map_to_online_node(target_nid); 52 51 info = (struct memregion_info) { 53 52 .target_node = target_nid, ··· 79 66 return; 80 67 81 68 out_resource: 69 + __release_region(&hmem_active, res.start, resource_size(&res)); 70 + out_active: 82 71 platform_device_put(pdev); 83 72 out_pdev: 84 73 memregion_free(id); ··· 88 73 89 74 static __init int hmem_register_one(struct resource *res, void *data) 90 75 { 91 - /* 92 - * If the resource is not a top-level resource it was already 93 - * assigned to a device by the HMAT parsing. 94 - */ 95 - if (res->parent != &iomem_resource) { 96 - pr_info("HMEM: skip %pr, already claimed\n", res); 97 - return 0; 98 - } 99 - 100 76 hmem_register_device(phys_to_target_node(res->start), res); 101 77 102 78 return 0;