|author||David Hildenbrand <email@example.com>||2021-02-25 17:17:24 -0800|
|committer||Linus Torvalds <firstname.lastname@example.org>||2021-02-26 09:41:00 -0800|
drivers/base/memory: don't store phys_device in memory blocks
No need to store the value for each and every memory block, as we can easily query the value at runtime. Reshuffle the members to optimize the memory layout. Also, let's clarify what the interface once was used for and why it's legacy nowadays. "phys_device" was used on s390x in older versions of lsmem/chmem, back when they were still part of s390x-tools. They were later replaced by the variants in linux-utils. For example, RHEL6 and RHEL7 contain lsmem/chmem from s390-utils. RHEL8 switched to versions from util-linux on s390x . "phys_device" was added with sysfs support for memory hotplug in commit 3947be1969a9 ("[PATCH] memory hotplug: sysfs and add/remove functions") in 2005. It always returned 0. s390x started returning something != 0 on some setups (if sclp.rzm is set by HW) in 2010 via commit 57b552ba0b2f ("memory hotplug/s390: set phys_device"). For s390x, it allowed for identifying which memory block devices belong to the same storage increment (RZM). Only if all memory block devices comprising a single storage increment were offline, the memory could actually be removed in the hypervisor. Since commit e5d709bb5fb7 ("s390/memory hotplug: provide memory_block_size_bytes() function") in 2013 a memory block device spans at least one storage increment - which is why the interface isn't really helpful/used anymore (except by old lsmem/chmem tools). There were once RFC patches to make use of "phys_device" in ACPI context; however, the underlying problem could be solved using different interfaces .  https://patchwork.kernel.org/patch/2163871/  https://github.com/ibm-s390-tools/s390-tools/blob/v2.1.0/zconf/lsmem  https://github.com/ibm-s390-tools/s390-tools/blob/v2.1.0/zconf/chmem  https://bugzilla.redhat.com/show_bug.cgi?id=1504134 Link: https://email@example.com Signed-off-by: David Hildenbrand <firstname.lastname@example.org> Acked-by: Michal Hocko <email@example.com> Reviewed-by: Oscar Salvador <firstname.lastname@example.org> Cc: Dave Hansen <email@example.com> Cc: Greg Kroah-Hartman <firstname.lastname@example.org> Cc: Gerald Schaefer <email@example.com> Cc: Jonathan Corbet <firstname.lastname@example.org> Cc: "Rafael J. Wysocki" <email@example.com> Cc: Mauro Carvalho Chehab <firstname.lastname@example.org> Cc: Ilya Dryomov <email@example.com> Cc: Vaibhav Jain <firstname.lastname@example.org> Cc: Tom Rix <email@example.com> Cc: Geert Uytterhoeven <firstname.lastname@example.org> Signed-off-by: Andrew Morton <email@example.com> Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
Diffstat (limited to 'Documentation')
2 files changed, 5 insertions, 4 deletions
diff --git a/Documentation/ABI/testing/sysfs-devices-memory b/Documentation/ABI/testing/sysfs-devices-memory
index 246a45b96d22..58dbc592bc57 100644
@@ -26,8 +26,9 @@ Date: September 2008
Contact: Badari Pulavarty <email@example.com>
The file /sys/devices/system/memory/memoryX/phys_device
- is read-only and is designed to show the name of physical
- memory device. Implementation is currently incomplete.
+ is read-only; it is a legacy interface only ever used on s390x
+ to expose the covered storage increment.
+Users: Legacy s390-tools lsmem/chmem
Date: September 2008
diff --git a/Documentation/admin-guide/mm/memory-hotplug.rst b/Documentation/admin-guide/mm/memory-hotplug.rst
index 5c4432c96c4b..245739f55ac7 100644
@@ -160,8 +160,8 @@ Under each memory block, you can see 5 files:
"online_movable", "online", "offline" command
which will be performed on all sections in the block.
-``phys_device`` read-only: designed to show the name of physical memory
- device. This is not well implemented now.
+``phys_device`` read-only: legacy interface only ever used on s390x to
+ expose the covered storage increment.
``removable`` read-only: contains an integer value indicating
whether the memory block is removable or not
removable. A value of 1 indicates that the memory