OpenCloudOS-Kernel/drivers/dax
Dan Williams 472faf72b3 device-dax: Fix duplicate 'hmem' device registration
So called "soft-reserved" memory is an EFI conventional memory range
with the EFI_MEMORY_SP attribute set. That attribute indicates that the
memory is not part of the platform general purpose memory pool and may
want some consideration from the system administrator about whether to
keep that memory set aside for dedicated access through device-dax (map
a device file), or assigned to the page allocator as another general
purpose memory node target.

Absent an ACPI HMAT table the default device-dax registration creates
coarse grained devices that are delineated by EFI Memory Map entries.
With the HMAT the devices are delineated by the finer grained ranges
associated with the proximity domain of the memory target. I.e. the HMAT
describes the properties of performance differentiated memory and each
unique performance description results in a unique target proximity
domain where each memory proximity domain has an associated SRAT entry
that delineates the address range.

The intent was that SRAT-defined device-dax instances are registered
first. Then any left-over address range with the EFI_MEMORY_SP
attribute, but not covered by the SRAT, would have a coarse grained
device-dax instance established. However, the scheme to detect what
ranges are left to be assigned to a device was buggy and resulted in
multiple overlapping device-dax instances. Fix this by using explicit
tracking for which ranges have been handled.

Now, this new approach may leave memory stranded in the presence of
broken platform firmware that fails to fully describe all EFI_MEMORY_SP
ranges in the HMAT. That requires a deeper fix if it becomes a problem
in practice.

Reported-by: "Tallam Mahendra Kumar" <tallam.mahendra.kumar@intel.com>
Reported-by: Mustafa Hajeer <mustafa.hajeer@intel.com>
Debugged-by: Vishal Verma <vishal.l.verma@intel.com>
Tested-by: Vishal Verma <vishal.l.verma@intel.com>
Link: https://lore.kernel.org/r/166890823379.4183293.15333502171004313377.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2022-11-21 15:34:40 -08:00
..
hmem device-dax: Fix duplicate 'hmem' device registration 2022-11-21 15:34:40 -08:00
pmem dax: Kill DEV_DAX_PMEM_COMPAT 2021-11-24 19:21:35 -08:00
Kconfig dax: remove CONFIG_DAX_DRIVER 2021-12-04 08:58:51 -08:00
Makefile dax: Kill DEV_DAX_PMEM_COMPAT 2021-11-24 19:21:35 -08:00
bus.c Merge branch 'akpm' (patches from Andrew) 2022-01-15 20:37:06 +02:00
bus.h Merge branch 'akpm' (patches from Andrew) 2022-01-15 20:37:06 +02:00
dax-private.h device-dax: add an 'align' attribute 2020-10-13 18:38:28 -07:00
device.c fs: Convert __set_page_dirty_no_writeback to noop_dirty_folio 2022-03-16 13:37:05 -04:00
kmem.c mm/demotion/dax/kmem: set node's abstract distance to MEMTIER_DEFAULT_DAX_ADISTANCE 2022-09-26 19:46:11 -07:00
pmem.c dax: Kill DEV_DAX_PMEM_COMPAT 2021-11-24 19:21:35 -08:00
super.c dax: Remove usage of the deprecated ida_simple_xxx API 2022-09-29 17:29:27 -07:00