RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1794160 - lsmem on ARM system does not report useful information
Summary: lsmem on ARM system does not report useful information
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: util-linux
Version: 8.1
Hardware: aarch64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Karel Zak
QA Contact: Radka Brychtova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-22 19:33 UTC by Ben Crocker
Modified: 2020-07-08 10:22 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-08 10:22:44 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ben Crocker 2020-01-22 19:33:05 UTC
Description of problem:

The 'lsmem' command on an ARM system I'm using
(hpe-apollo-cn99xx-12.khw4.lab.eng.bos.redhat.com)
produces the following message:

lsmem: This system does not support memory blocks

This seems like an easily fixable friendliness issue;
fixing it would bring lsmem up to the standards of 
other tools like lscpu.


Version-Release number of selected component (if applicable):
util-linux.aarch64    2.32.1-22.el8

How reproducible:

All the time.


Steps to Reproduce:
1. Install RHEL 8
2. Log in
3. Run lsmem command

Actual results:

Unhelpful message: lsmem: This system does not support memory blocks


Expected results:

The 'lsmem' command should at least produce the summary I see on
other archs, e.g.:

X86: 
Memory block size:       128M
Total online memory:    31.5G
Total offline memory:      0B

Power:
Memory block size:       256M
Total online memory:     256G
Total offline memory:      0B

S390x:

RANGE                                 SIZE  STATE REMOVABLE BLOCK
0x0000000000000000-0x000000007fffffff   2G online        no   0-7

Memory block size:       256M
Total online memory:       2G
Total offline memory:      0Binfo:

Comment 1 Karel Zak 2020-07-07 12:47:10 UTC
> lsmem: This system does not support memory blocks

This error message means that lsmem cannot access file "/sys/devices/system/memory/block_size_bytes". Can you provide 

 ls /sys/devices/system/memory

from your system. 

Note that the summary output is calculated from the /sys data ...

Comment 2 Ben Crocker 2020-07-07 16:39:13 UTC
There is no /sys/devices/system/memory directory on the system in question.
I think it would be useful to print the message, followed by the
"Total online memory" message.

Comment 3 Karel Zak 2020-07-08 07:45:34 UTC
I have updated upstream tree to report the problem in a more obvious way, now:

 $ lsmem
 lsmem: cannot open /sys/devices/system/memory: No such file or directory

I don't think that generates a summary from another source (e.g. /proc) makes any sense. The command is designed to list memory ranges, and it's not free(1) replacement.

Note that /sys/devices/system/memory is under active kernel development. Maybe later it will provide some information also for (your) ARM. 
David (added to CC:), any objection?

Comment 4 David Hildenbrand 2020-07-08 08:50:59 UTC
/sys/devices/system/memory is only really helpful for memory hotplug. Otherwise it's just noise. In fact, it's only compiled into the kernel if we compile support for memory hotplug.

Now, on arm64 we don't have memory hotplug support, therefore no /sys/devices/system/memory. arm64 memory hotplug support is upstream (and code is included downstream), but it's not enabled yet in downstream kernels. Once we unlock that we also get /sys/devices/system/memory, and therefore, lsmem.

"man lsmem" somewhat indicates that this is glued to memory hotplug capabilities ("The command also shows the memory block size and the amount of
memory in online and offline state.") - the concept of online/offline memory ranges only exists with memory hot(un)plug.

Side note: The "REMOVABLE" output of lsmem is no longer really helpful on recent kernels. It's output will either be "Yes" or "No".


Note You need to log in before you can comment on or make changes to this bug.