Skip to content

Commit

Permalink
Merge pull request #7506 from mpirvu/cgroupmem
Browse files Browse the repository at this point in the history
Do not fail retrieveLinuxCgroupMemoryStats if swappiness is unavailable
  • Loading branch information
babsingh authored Oct 29, 2024
2 parents 3172ea3 + 42fa327 commit 205c540
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion port/unix/omrsysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -3502,6 +3502,7 @@ retrieveLinuxCgroupMemoryStats(struct OMRPortLibrary *portLibrary, struct OMRCgr
cgroupMemInfo->memoryUsage = OMRPORT_MEMINFO_NOT_AVAILABLE;
cgroupMemInfo->memoryAndSwapLimit = OMRPORT_MEMINFO_NOT_AVAILABLE;
cgroupMemInfo->memoryAndSwapUsage = OMRPORT_MEMINFO_NOT_AVAILABLE;
cgroupMemInfo->swappiness = OMRPORT_MEMINFO_NOT_AVAILABLE;
cgroupMemInfo->cached = OMRPORT_MEMINFO_NOT_AVAILABLE;

if (OMR_ARE_ANY_BITS_SET(PPG_sysinfoControlFlags, OMRPORT_SYSINFO_CGROUP_V1_AVAILABLE)) {
Expand Down Expand Up @@ -3563,7 +3564,11 @@ retrieveLinuxCgroupMemoryStats(struct OMRPortLibrary *portLibrary, struct OMRCgr

rc = readCgroupSubsystemFile(portLibrary, OMR_CGROUP_SUBSYSTEM_MEMORY, CGROUP_MEMORY_SWAPPINESS, numItemsToRead, "%" SCNu64, &cgroupMemInfo->swappiness);
if (0 != rc) {
goto _exit;
cgroupMemInfo->swappiness = OMRPORT_MEMINFO_NOT_AVAILABLE;
/* Cgroup swappiness may not always be available (e.g. Cgroup v2),
* so do not treat this condition as an error
*/
rc = 0;
}

/* Read value of page cache memory from memory.stat file */
Expand Down

0 comments on commit 205c540

Please sign in to comment.