• Dan Williams's avatar
    ACPI: NUMA: HMAT: Register "soft reserved" memory as an "hmem" device · cf8741ac
    Dan Williams authored
    Memory that has been tagged EFI_MEMORY_SP, and has performance
    properties described by the ACPI HMAT is expected to have an application
    specific consumer.
    
    Those consumers may want 100% of the memory capacity to be reserved from
    any usage by the kernel. By default, with this enabling, a platform
    device is created to represent this differentiated resource.
    
    The device-dax "hmem" driver claims these devices by default and
    provides an mmap interface for the target application.  If the
    administrator prefers, the hmem resource range can be made available to
    the core-mm via the device-dax hotplug facility, kmem, to online the
    memory with its own numa node.
    
    This was tested with an emulated HMAT produced by qemu (with the pending
    HMAT enabling patches), and "efi_fake_mem=8G@9G:0x40000" on the kernel
    command line to mark the memory ranges associated with node2 and node3
    as EFI_MEMORY_SP.
    
    qemu numa configuration options:
    
    -numa node,mem=4G,cpus=0-19,nodeid=0
    -numa node,mem=4G,cpus=20-39,nodeid=1
    -numa node,mem=4G,nodeid=2
    -numa node,mem=4G,nodeid=3
    -numa dist,src=0,dst=0,val=10
    -numa dist,src=0,dst=1,val=21
    -numa dist,src=0,dst=2,val=21
    -numa dist,src=0,dst=3,val=21
    -numa dist,src=1,dst=0,val=21
    -numa dist,src=1,dst=1,val=10
    -numa dist,src=1,dst=2,val=21
    -numa dist,src=1,dst=3,val=21
    -numa dist,src=2,dst=0,val=21
    -numa dist,src=2,dst=1,val=21
    -numa dist,src=2,dst=2,val=10
    -numa dist,src=2,dst=3,val=21
    -numa dist,src=3,dst=0,val=21
    -numa dist,src=3,dst=1,val=21
    -numa dist,src=3,dst=2,val=21
    -numa dist,src=3,dst=3,val=10
    -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,base-lat=10,latency=5
    -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=5
    -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,base-lat=10,latency=10
    -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=10
    -numa hmat-lb,initiator=0,target=2,hierarchy=memory,data-type=access-latency,base-lat=10,latency=15
    -numa hmat-lb,initiator=0,target=2,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=15
    -numa hmat-lb,initiator=0,target=3,hierarchy=memory,data-type=access-latency,base-lat=10,latency=20
    -numa hmat-lb,initiator=0,target=3,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=20
    -numa hmat-lb,initiator=1,target=0,hierarchy=memory,data-type=access-latency,base-lat=10,latency=10
    -numa hmat-lb,initiator=1,target=0,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=10
    -numa hmat-lb,initiator=1,target=1,hierarchy=memory,data-type=access-latency,base-lat=10,latency=5
    -numa hmat-lb,initiator=1,target=1,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=5
    -numa hmat-lb,initiator=1,target=2,hierarchy=memory,data-type=access-latency,base-lat=10,latency=15
    -numa hmat-lb,initiator=1,target=2,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=15
    -numa hmat-lb,initiator=1,target=3,hierarchy=memory,data-type=access-latency,base-lat=10,latency=20
    -numa hmat-lb,initiator=1,target=3,hierarchy=memory,data-type=access-bandwidth,base-bw=20,bandwidth=20
    
    Result:
    
    [
      {
        "path":"\/platform\/hmem.1",
        "id":1,
        "size":"4.00 GiB (4.29 GB)",
        "align":2097152,
        "devices":[
          {
            "chardev":"dax1.0",
            "size":"4.00 GiB (4.29 GB)"
          }
        ]
      },
      {
        "path":"\/platform\/hmem.0",
        "id":0,
        "size":"4.00 GiB (4.29 GB)",
        "align":2097152,
        "devices":[
          {
            "chardev":"dax0.0",
            "size":"4.00 GiB (4.29 GB)"
          }
        ]
      }
    ]
    
    [..]
    240000000-43fffffff : Soft Reserved
      240000000-33fffffff : hmem.0
        240000000-33fffffff : dax0.0
      340000000-43fffffff : hmem.1
        340000000-43fffffff : dax1.0
    Reviewed-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
    Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
    Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    cf8741ac
hmat.c 20.9 KB