You are not logged in.

#1 2024-06-27 07:44:28

tcn
Member
Registered: 2011-09-30
Posts: 69

8G RAM gone after boot

Hi!

A whopping ~8G RAM are gone right after boot and before X11/KDE without anything special running. 6.6.35-2 (and prior), amdgpu.

Kernel options I've tried so far: systemd.unit=rescue.target, systemd.zram=0, amdgpu.gttsize=512, amdgpu.gartsize=128. All pretty much to no avail, making only marginal differences at best.

These command where executed in rescue.target:

# free -h
Mem:            62Gi       7.4Gi        57Gi        10Mi       415Mi        55Gi
Swap:           62Gi          0B        62Gi
MemTotal:       65785924 kB
# smem -tk
  PID User     Command                         Swap      USS      PSS      RSS 
 1293 root     /usr/lib/systemd/systemd-su        0   816.0K     1.5M     5.1M 
 1271 systemd-timesync /usr/lib/systemd/systemd-ti        0     1.6M     2.8M     7.4M 
 1419 root     (udev-worker)                      0   624.0K     2.9M     7.0M 
 1364 root     ssh-agent                          0     2.8M     2.9M     3.8M 
  711 root     /usr/lib/systemd/systemd-ud        0   696.0K     3.9M    10.8M 
 1311 root     bash                               0     4.0M     4.5M     6.2M 
  635 root     /usr/lib/systemd/systemd-jo        0     5.6M     6.8M    11.5M 
    1 root     /sbin/init                         0     6.4M     8.1M    13.4M 
 1420 root     python /usr/bin/smem -tk           0    13.1M    13.7M    15.6M 
-------------------------------------------------------------------------------
    9 2                                           0    35.7M    47.1M    80.9M 
MemTotal:       65785924 kB
MemFree:        59814232 kB
MemAvailable:   57983032 kB
Buffers:            3080 kB
Cached:           381892 kB
SwapCached:            0 kB
Active:            71196 kB
Inactive:         327788 kB
Active(anon):      24736 kB
Inactive(anon):        0 kB
Active(file):      46460 kB
Inactive(file):   327788 kB
Unevictable:           8 kB
Mlocked:               0 kB
SwapTotal:      65785852 kB
SwapFree:       65785852 kB
Zswap:                 0 kB
Zswapped:              0 kB
Dirty:              7328 kB
Writeback:             0 kB
AnonPages:         14072 kB
Mapped:            20872 kB
Shmem:             10712 kB
KReclaimable:      47800 kB
Slab:             259660 kB
SReclaimable:      47800 kB
SUnreclaim:       211860 kB
KernelStack:       10640 kB
PageTables:          572 kB
SecPageTables:         0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    96581660 kB
Committed_AS:      39452 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      601580 kB
VmallocChunk:          0 kB
Percpu:           112128 kB
HardwareCorrupted:     0 kB
AnonHugePages:      2048 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
Unaccepted:            0 kB
HugePages_Total:    2048
HugePages_Free:     2048
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:         4194304 kB
DirectMap4k:      332492 kB
DirectMap2M:    10024960 kB
DirectMap1G:    56623104 kB

Any advise how to proceed further?

RAM consumption on a Manjaro USB is 2.5G on the same machine.

thx
tcn

Last edited by tcn (2024-06-27 08:06:14)

Offline

#2 2024-06-27 10:25:28

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,225

Re: 8G RAM gone after boot

Integrated GPU that reserves lots of system ram ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2024-06-27 10:42:11

cryptearth
Member
Registered: 2024-02-03
Posts: 1,204

Re: 8G RAM gone after boot

please post your hardware specs (board, cpu, (igpu), gpu, ram)

Offline

#4 2024-06-27 12:02:16

tcn
Member
Registered: 2011-09-30
Posts: 69

Re: 8G RAM gone after boot

ASUS Zenith Extreme, Threadripper 1950x, 64GB RAM, Radeon  RX 570 4GB (which chromium fails to use for video decoding up to this day...)

Offline

#5 2024-06-27 13:53:24

seth
Member
Registered: 2012-09-03
Posts: 60,756

Re: 8G RAM gone after boot

Lone_Wolf wrote:

Integrated GPU that reserves lots of system ram ?

Please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

Offline

#6 2024-06-27 14:04:28

tcn
Member
Registered: 2011-09-30
Posts: 69

Re: 8G RAM gone after boot

Offline

#7 2024-06-27 15:14:06

seth
Member
Registered: 2012-09-03
Posts: 60,756

Re: 8G RAM gone after boot

amdgpu grants itself half:

Jun 27 07:23:05 box kernel: [drm] amdgpu: 4096M of VRAM memory ready
Jun 27 07:23:05 box kernel: [drm] amdgpu: 32122M of GTT memory ready.

And zram is in full force:

Jun 27 07:23:06 box kernel: Adding 65785852k swap on /dev/zram0.  Priority:100 extents:1 across:65785852k SSDsc

And there's oc a lot of stuff running, 8GB isn't implausible in this situation at all.

This here is whacko:

MemTotal:       65785924 kB
MemFree:        59814232 kB
MemAvailable:   57983032 kB

you've more free than available ram…

What does /proc/meminfo here actually look like?

systemd.unit=rescue.target, systemd.zram=0, amdgpu.gttsize=512, amdgpu.gartsize=128

Offline

#8 2024-06-27 15:42:10

tcn
Member
Registered: 2011-09-30
Posts: 69

Re: 8G RAM gone after boot

seth wrote:

And there's oc a lot of stuff running

There is? Where? I thought I had disabled it all a long time ago neutral

seth wrote:

What does /proc/meminfo here actually look like?

systemd.unit=rescue.target, systemd.zram=0, amdgpu.gttsize=512, amdgpu.gartsize=128

There you go:

Jun 27 17:24:06 box kernel: Linux version 6.6.35-2-lts (linux-lts@archlinux) (gcc (GCC) 14.1.1 20240522, GNU ld (GNU Binutils) 2.42.0) #1 SMP PREEMPT_DYNAMIC Fri, 21 Jun 2024 21:05:23 +0000
Jun 27 17:24:06 box kernel: Command line: initrd=\amd-ucode.img initrd=\initramfs-linux-lts.img root=PARTUUID=f100f562-2098-4949-b9d1-4ab250db7653 rootfstype=btrfs rw add_efi_memmap audit=0 radeon.modeset=1 pcie_aspm=off systemd.zram=0 systemd.unit=rescue.target amdgpu.gttsize=512 amdgpu.gartsize=128
MemTotal:       65785932 kB
MemFree:        60253320 kB
MemAvailable:   58385056 kB
Buffers:            3080 kB
Cached:           309512 kB
SwapCached:            0 kB
Active:            69956 kB
Inactive:         256724 kB
Active(anon):      24600 kB
Inactive(anon):        0 kB
Active(file):      45356 kB
Inactive(file):   256724 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Zswap:                 0 kB
Zswapped:              0 kB
Dirty:              2016 kB
Writeback:             0 kB
AnonPages:         13580 kB
Mapped:            20648 kB
Shmem:             10512 kB
KReclaimable:      46208 kB
Slab:             251720 kB
SReclaimable:      46208 kB
SUnreclaim:       205512 kB
KernelStack:       10640 kB
PageTables:          516 kB
SecPageTables:         0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    30795812 kB
Committed_AS:      39084 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      284076 kB
VmallocChunk:          0 kB
Percpu:           110080 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
Unaccepted:            0 kB
HugePages_Total:    2048
HugePages_Free:     2048
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:         4194304 kB
DirectMap4k:      262860 kB
DirectMap2M:     9046016 kB
DirectMap1G:    57671680 kB

It's still over 7GB. While booting an out-of-the-box Manjaro live USB on the same system with the same open-source amdgpu drivers gets me down to 2.5. And I think that's even after KDE...

Offline

#9 2024-06-27 17:11:51

seth
Member
Registered: 2012-09-03
Posts: 60,756

Re: 8G RAM gone after boot

You're actually just using shy above 300MB  (the brunt of that being the file cache) - the RAM is most likely going to the GPU - "somehow".
Try to add "transparent_hugepage=never" to the kernel parameters.

Offline

#10 2024-06-27 17:47:06

tcn
Member
Registered: 2011-09-30
Posts: 69

Re: 8G RAM gone after boot

Makes no difference.

# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
MemTotal:       65785932 kB
MemFree:        59191596 kB
MemAvailable:   57469056 kB
Buffers:            3080 kB
Cached:           586652 kB
SwapCached:            0 kB
Active:           326836 kB
Inactive:         334800 kB
Active(anon):      89648 kB
Inactive(anon):        0 kB
Active(file):     237188 kB
Inactive(file):   334800 kB
Unevictable:        1872 kB
Mlocked:            1872 kB
SwapTotal:      65785852 kB
SwapFree:       65785852 kB
Zswap:                 0 kB
Zswapped:              0 kB
Dirty:                88 kB
Writeback:             0 kB
AnonPages:         74036 kB
Mapped:            92348 kB
Shmem:             15860 kB
KReclaimable:      67744 kB
Slab:             308272 kB
SReclaimable:      67744 kB
SUnreclaim:       240528 kB
KernelStack:       12016 kB
PageTables:         3108 kB
SecPageTables:         0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    96581664 kB
Committed_AS:     689832 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      610724 kB
VmallocChunk:          0 kB
Percpu:           131584 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
Unaccepted:            0 kB
HugePages_Total:    2048
HugePages_Free:     2048
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:         4194304 kB
DirectMap4k:      379596 kB
DirectMap2M:    11026432 kB
DirectMap1G:    55574528 kB

Offline

#11 2024-06-27 20:29:24

seth
Member
Registered: 2012-09-03
Posts: 60,756

Re: 8G RAM gone after boot

Just to isolate the cause, same when booting "nomodeset" or outright blacklisting amdgpu?

Offline

#12 2024-06-28 06:49:02

tcn
Member
Registered: 2011-09-30
Posts: 69

Re: 8G RAM gone after boot

Again, no effect (nomodeset).

# lsmod | grep -c amdgpu
0
MemTotal:       65785932 kB
MemFree:        59076428 kB
MemAvailable:   57399576 kB
Buffers:            2996 kB
Cached:           675740 kB
SwapCached:            0 kB
Active:           330680 kB
Inactive:         431732 kB
Active(anon):      99232 kB
Inactive(anon):        0 kB
Active(file):     231448 kB
Inactive(file):   431732 kB
Unevictable:        4864 kB
Mlocked:            1792 kB
SwapTotal:      65785852 kB
SwapFree:       65785852 kB
Zswap:                 0 kB
Zswapped:              0 kB
Dirty:               384 kB
Writeback:             0 kB
AnonPages:         85916 kB
Mapped:            87368 kB
Shmem:             13872 kB
KReclaimable:      67924 kB
Slab:             296644 kB
SReclaimable:      67924 kB
SUnreclaim:       228720 kB
KernelStack:       11216 kB
PageTables:         3044 kB
SecPageTables:         0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    96581664 kB
Committed_AS:     679604 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      556156 kB
VmallocChunk:          0 kB
Percpu:           131584 kB
HardwareCorrupted:     0 kB
AnonHugePages:     10240 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:     12288 kB
FilePmdMapped:      2048 kB
CmaTotal:              0 kB
CmaFree:               0 kB
Unaccepted:            0 kB
HugePages_Total:    2048
HugePages_Free:     2048
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:         4194304 kB
DirectMap4k:      377548 kB
DirectMap2M:    11028480 kB
DirectMap1G:    55574528 kB

Offline

#13 2024-06-28 06:59:16

seth
Member
Registered: 2012-09-03
Posts: 60,756

Re: 8G RAM gone after boot

Ok, wIld guess: spurious tmpfs usage?

df -h

Offline

#14 2024-06-28 07:28:32

tcn
Member
Registered: 2011-09-30
Posts: 69

Re: 8G RAM gone after boot

Filesystem            Size  Used Avail Use% Mounted on
dev                    32G     0   32G   0% /dev
run                    32G   11M   32G   1% /run
efivarfs              128K   61K   63K  50% /sys/firmware/efi/efivars
/dev/nvme1n1p2        477G  231G  207G  53% /
tmpfs                  32G  3,7G   28G  12% /dev/shm
/dev/nvme1n1p2        477G  231G  207G  53% /home
/dev/nvme1n1p2        477G  231G  207G  53% /var/cache
/dev/nvme1n1p2        477G  231G  207G  53% /var/lib/postgres
/dev/nvme1n1p2        477G  231G  207G  53% /var/log
/dev/nvme1n1p1        511M  373M  139M  73% /boot
/dev/nvme1n1p2        477G  231G  207G  53% /var/tmp
/dev/nvme0n1p1        477G  427G   50G  90% /mnt/970pro
tmpfs                 2,0G  368M  1,7G  18% /tmp
tmpfs                 100M     0  100M   0% /var/cache/tcn/chromium
tmpfs                 100M     0  100M   0% /var/cache/tcn/vivaldi
tmpfs                 100M     0  100M   0% /var/cache/tcn/mozilla
tmpfs                 6,3G  172K  6,3G   1% /run/user/1024
qp:/homes/tcn         3,0T  1,9T  1,2T  63% /home/qnap/tcn
qp:/Multimedia/photo  3,0T  1,9T  1,2T  63% /home/qnap/photo

Offline

#15 2024-06-28 08:19:40

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,225

Re: 8G RAM gone after boot

tmpfs                  32G  3,7G   28G  12% /dev/shm

that's usually zero if the system is not doing much.

/dev/nvme1n1p2        477G  231G  207G  53% /
/dev/nvme1n1p2        477G  231G  207G  53% /home
/dev/nvme1n1p2        477G  231G  207G  53% /var/cache
/dev/nvme1n1p2        477G  231G  207G  53% /var/lib/postgres
/dev/nvme1n1p2        477G  231G  207G  53% /var/log
/dev/nvme1n1p2        477G  231G  207G  53% /var/tmp

Don't think i've seen that before, how and why did you configure that ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#16 2024-06-28 09:18:20

tcn
Member
Registered: 2011-09-30
Posts: 69

Re: 8G RAM gone after boot

Lone_Wolf wrote:
tmpfs                  32G  3,7G   28G  12% /dev/shm

that's usually zero if the system is not doing much.

You're right, mea culpa, took it from a running env. It's empty in rescue.target.

Lone_Wolf wrote:

Don't think i've seen that before, how and why did you configure that ?

These are just btrfs subvolumes.

Offline

#17 2024-06-28 15:47:55

seth
Member
Registered: 2012-09-03
Posts: 60,756

Re: 8G RAM gone after boot

So status quo:
You've 62.7G total, 57.5G free, 55.7G available w/ 0.55G actually used by userspace and kernel.
The available calculation is obviously nonsense, so against the *free* RAM, you're losing ~4.7G (one DVD…)

* It's not the kernel version (you tested LTS? Can you try to just downgrade the kernel to the manjaro version?)
* It's not amdgpu, GART/GTT
* it's not tmpfs usage
* [edit] it's not THP

Compare lsmod on the manjaro and arch system - something's clearly leaking lots of RAM.
If you're using any OOT modules, start there.

Last edited by seth (2024-06-28 15:48:15)

Offline

#18 2024-12-31 09:40:34

tcn
Member
Registered: 2011-09-30
Posts: 69

Re: 8G RAM gone after boot

seth wrote:

* It's not amdgpu, GART/GTT

I just noticed that amdgpu.gttsize < 32 is ignored (at least as of now). Setting it to 32 renders the machine unusable (at least on wayland), dmesg busy-loops:

[amdgpu] *ERROR* Not enough memory for command submission!

Offline

Board footer

Powered by FluxBB