How to determine anonymous shared memory region created by memfd_create() syscall from VMcore?

Solution Verified - Updated -

Issue

  • How to determine anonymous shared memory region created by memfd_create(2) syscall from VMcore?
  • How to determine the shared memory regions created by the "memfd" feature of the Linux kernel from VMcore?
  • How to determine which process uses the shared memory regions created by the "memfd" feature of the Linux kernel from VMcore?
  • Unable to account for the shared memory usage and the process using the shared memory region from VMcore.
The crash built-in "kmem -i" command shows that the total memory allocated to the shared memory region is 233.5 GB.

crash> kmem -i
                  PAGES        TOTAL      PERCENTAGE
    TOTAL MEM  65960140     251.6 GB         ----
         FREE    154157     602.2 MB    0% of TOTAL MEM
         USED  65805983       251 GB   99% of TOTAL MEM
       SHARED  61220393     233.5 GB   92% of TOTAL MEM
      BUFFERS      7354      28.7 MB    0% of TOTAL MEM
       CACHED  61160804     233.3 GB   92% of TOTAL MEM
         SLAB    298648       1.1 GB    0% of TOTAL MEM

   TOTAL HUGE         0            0         ----
    HUGE FREE         0            0    0% of TOTAL HUGE

   TOTAL SWAP   8388607        32 GB         ----
    SWAP USED   5892394      22.5 GB   70% of TOTAL SWAP
    SWAP FREE   2496213       9.5 GB   29% of TOTAL SWAP

 COMMIT LIMIT  41368677     157.8 GB         ----
    COMMITTED  78532523     299.6 GB  189% of TOTAL LIMIT

The crash built-in "ipcs -m" commands show that the total memory allocated to the shared memory region is 0.68 MiB.

crash> ipcs -m | awk '{ total += $6 } END { printf "Total Shared Memory: %.02f MiB\n", total/2^20 }'
Total Shared Memory: 0.68 MiB

crash> ipcs -m
SHMID_KERNEL     KEY      SHMID      UID     PERMS BYTES      NATTCH STATUS
ffff978ec5a32f40 f9000c46 0          0       600   222        1       
ffff978ecf99b0c0 02002235 1          1000755 666   2048       0       
ffff978ecf99a7c0 01002230 2          1000755 666   18168      0       
ffff978ecf99adc0 02002238 3          1000755 666   2048       0       
ffff978ecf99ac40 02002253 5          1000755 666   2560       0       
ffff978ec639dc00 41002236 7          1000755 666   768        0       
ffff978ec639c040 41002237 18         1000755 666   5376       0       
ffff978ec639c880 4100223a 20         1000755 666   768        0       
ffff978ec639cd00 4100223b 22         1000755 666   768        0       
ffff978ec639ca00 4100223e 23         1000755 666   256        0       
ffff978ec639c640 4100223f 25         1000755 666   768        0       
ffff978ec639d3c0 41002240 28         1000755 666   1280       0       
ffff978ec639c700 41002241 30         1000755 666   768        0       
ffff978ec639c7c0 41002242 31         1000755 666   256        0       
ffff978ec639cb80 41002243 32         1000755 666   256        0       
ffff978ef00304c0 41002239 34         1000755 666   768        0       
ffff978eccf14a00 41002245 37         1000755 666   256        0       
ffff978eccf14340 41002247 38         1000755 666   256        0       
ffff978eccf159c0 41002248 39         1000755 666   256        0       
ffff978eccf14c40 41002249 40         1000755 666   256        0       
ffff978ef0031a80 4100223c 42         1000755 666   768        0       
ffff978eccf15840 4100224a 44         1000755 666   1280       0       
ffff978ef0030700 41002250 45         1000755 666   256        0       
ffff978eccf14ac0 4100224b 47         1000755 666   1280       0       
ffff978eccf15f00 4100224d 51         1000755 666   15236      0       
ffff978eccf15c00 4100224e 52         1000755 666   256        0       
ffff978eccf14dc0 4100224f 53         1000755 666   256        0       
ffff978eccf15000 41002251 54         1000755 666   256        0       
ffff978eccf156c0 41002252 56         1000755 666   768        0       
ffff97634bf6f540 4100224c 59         1000755 666   1792       0       
ffff978ed34bdd80 41002244 60         1000755 666   654460     0       

Environment

  • Red Hat Enterprise Linux release 7
  • memfd: memfd_create(2)
  • Azul System Zing Memory (Heap)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content