You are not logged in.
Pages: 1
https://imgur.com/a/7SdZwO6
When I try to disable swap file, swap gets locked but doesn't turn off, command hangs, sometimes it turns off normally but more often it just hangs
Is there anything that can be done?
sudo file -s /dev/nvme0n1p3
/dev/nvme0n1p3: Linux swap file, 4k page size, little endian, version 1, size 1048319 pages, 0 bad pages, no label, UUID=971a657c-e2a0-497f-b8fc-e334e4709771
And looks like there is no processes on swap
[Oleg@ArchLinux ~]$ smem -rs swap
PID User Command Swap USS PSS RSS
455605 root python /usr/bin/smem -rs sw 0 18804 20151 25960
455604 root sudo smem -rs swap 0 112 949 3004
455601 root sudo smem -rs swap 0 116 2132 10068
Free -h While attempting swapoff
free -h
total used free shared buff/cache available
Mem: 15Gi 6,7Gi 7,0Gi 1,6Gi 3,7Gi 8,8Gi
Swap: 11Mi 11Mi 0B
Free -h few seconds after close attempt to swapoff
total used free shared buff/cache available
Mem: 15Gi 6,7Gi 7,1Gi 1,6Gi 3,7Gi 8,9Gi
Swap: 4,0Gi 11Mi 4,0Gi
lsblk line
└─nvme0n1p3 259:3 0 4G 0 part [SWAP]
Last edited by xy1vro4 (2025-07-18 12:37:45)
Offline
What's the output of "swapon" before and "vmstat 1" while running swapoff?
Please on't post pictures of videos of this, you can tee the vmstat output into a file.
Online
What's the output of "swapon" before and "vmstat 1" while running swapoff?
Please on't post pictures of videos of this, you can tee the vmstat output into a file.
[Oleg@ArchLinux ~]$ swapon -s
Filename Type Size Used Priority
/dev/nvme0n1p3 partition 4193276 11892 -2
and "vmstat 1" while running swapoff
[Oleg@ArchLinux ~]$ vmstat 1
procs -----------memory---------- ---swap-- -----io---- -system-- -------cpu-------
r b swpd free buff cache si so bi bo in cs us sy id wa st gu
2 0 11892 7443240 11348 3760884 2 12 2408 674 10416 47 12 4 83 0 0 0
1 0 11892 7424568 11348 3760884 0 0 0 0 3480 2156 0 9 90 0 0 0
1 0 11892 7432372 11348 3757812 0 0 0 0 2792 2004 0 9 91 0 0 0
2 0 11892 7439060 11348 3759380 0 0 0 4556 2947 2244 0 9 91 0 0 0
1 0 11892 7444448 11348 3759380 0 0 0 0 2427 1434 0 9 91 0 0 0
1 0 11892 7442856 11348 3759380 0 0 0 0 2967 1853 0 9 91 0 0 0
1 0 11892 7434376 11348 3759380 0 0 0 0 3665 2022 1 9 90 0 0 0
1 0 11892 7435736 11348 3759380 0 0 0 0 3065 1616 0 9 91 0 0 0
1 0 11892 7434588 11348 3759572 0 0 0 596 3114 2196 0 9 91 0 0 0
1 0 11892 7439456 11348 3759620 0 0 0 0 2900 1778 0 9 91 0 0 0
1 0 11892 7446592 11348 3759620 0 0 0 0 2914 1530 0 9 91 0 0 0
1 0 11892 7426080 11348 3759620 0 0 0 0 4070 2159 0 9 90 0 0 0
1 0 11892 7424048 11348 3759620 0 0 0 284 2609 1438 0 9 91 0 0 0
1 0 11892 7428264 11348 3759636 0 0 0 12 3325 2158 0 9 91 0 0 0
1 0 11892 7429532 11348 3759636 0 0 0 0 3068 1488 0 9 91 0 0 0
1 0 11892 7431228 11348 3759720 0 0 0 72 2977 1844 0 9 91 0 0 0
2 0 11892 7426572 11348 3759780 0 0 0 0 3359 2147 0 9 90 0 0 0
1 0 11892 7432320 11348 3759780 0 0 0 0 2922 1951 0 9 91 0 0 0
1 0 11892 7439660 11348 3759780 0 0 0 0 2884 1964 0 9 91 0 0 0
1 0 11892 7438668 11348 3759780 0 0 0 0 2881 1642 0 9 91 0 0 0
1 0 11892 7439728 11348 3759780 0 0 0 0 3286 2016 0 9 91 0 0 0
1 0 11892 7418440 11348 3759780 0 0 0 0 4513 3911 0 9 90 0 0 0
1 0 11892 7418612 11348 3759912 0 0 0 572 4529 4537 0 9 91 0 0 0
Do i need to make longer statistic of "vmstat 1" output?
Sry, got it, no videos
Last edited by xy1vro4 (2025-07-16 12:29:38)
Offline
2 0 11892 7443240 11348 3760884 2 12 2408 674 10416 47 12 4 83 0 0 0
1 0 11892 7424568 11348 3760884 0 0 0 0 3480 2156 0 9 90 0 0 0
swap clears immediately and it's only one swap device, do you have zswap enabled (and what if you disable it first)
https://wiki.archlinux.org/title/Zswap
Online
2 0 11892 7443240 11348 3760884 2 12 2408 674 10416 47 12 4 83 0 0 0 1 0 11892 7424568 11348 3760884 0 0 0 0 3480 2156 0 9 90 0 0 0
swap clears immediately and it's only one swap device, do you have zswap enabled (and what if you disable it first)
https://wiki.archlinux.org/title/Zswap
i wrote 0 to /sys/module/zswap/parameters/enabled
Now there is word "N" inside
[Oleg@ArchLinux ~]$ cat /sys/module/zswap/parameters/enabled
N
but the swap file still can't be disabled or you want to say that it is being disabled but doesn't seem to signal about it
Offline
If swapoff still hangs after this, check the tail of dmesg/the system journal (there would have to be some sort of IO errors)
What does "swapon" btw. respond while swapoff freezes?
Ultimately
strace -f -o /tmp/swapoff.strace swapoff --all
Online
If swapoff still hangs after this, check the tail of dmesg/the system journal (there would have to be some sort of IO errors)
What does "swapon" btw. respond while swapoff freezes?Ultimately
strace -f -o /tmp/swapoff.strace swapoff --all
during swapoff freez swapon output is
NAME TYPE SIZE USED PRIO
/dev/nvme0n1p3 partition 4G 11,6M -2
There is output of
strace -f -o /tmp/swapoff.strace swapoff --all
is it ok to use pastebin? i just don't sure how to paste like alot text here or pin file
https://pastebin.com/JpM9KvWL
And when I kill the process, this is written to end of the log
488567 swapoff("/dev/nvme0n1p3") = -1 EINTR (Прерван системный вызов)
488567 --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=488564, si_uid=1000} ---
488567 +++ killed by SIGHUP +++
Last edited by xy1vro4 (2025-07-16 13:29:13)
Offline
So it's hanging in https://man.archlinux.org/man/swapoff.2.en (the system call) and swapon shows it still in use (despite vmstat) - btw. how and why is is always at 11,6MB?
Is this still the same instance (ie. there're pot. multiple hanging swapoff calls)?
Do you run into the same problem after a reboot?
(Also, not sure what to make out of that, but while si and so drop, swpd actually stays at the value)
Online
"dmesg | grep -iE 'nvme|swap|error|fail'" output
https://pastebin.com/R51qzRNs
have alot off errors
[78387.433121] NVRM: Xid (PCI:0000:01:00): 69, pid=1976, name=v2rayN, Class Error: ChId 000b, Class 0000902d, Offset 0000023c, Data 00000000, ErrorCode 00000004
[78395.198521] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.SAT0.PRT2._GTF.DSSP], AE_NOT_FOUND (20240827/psargs-332)
[78395.198553] ACPI Error: Aborting method \_SB.PCI0.SAT0.PRT2._GTF due to previous error (AE_NOT_FOUND) (20240827/psparse-529)
After each set of same errors there is something about swap
[94240.327687] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS
Offline
So it's hanging in https://man.archlinux.org/man/swapoff.2.en (the system call) and swapon shows it still in use (despite vmstat) - btw. how and why is is always at 11,6MB?
Is this still the same instance (ie. there're pot. multiple hanging swapoff calls)?
Do you run into the same problem after a reboot?(Also, not sure what to make out of that, but while si and so drop, swpd actually stays at the value)
I can answer right away that after the restart everything works fine, I can turn off the swap at any time.
And the other points, I need to think about it for a second
BTW sometimes it freez on like 50mb, so it's like +-50mb usualy
Last edited by xy1vro4 (2025-07-16 14:25:06)
Offline
[ 6.269982] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS
[31314.700484] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS
[79323.986643] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS
[94240.327687] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS
could easily corrrespond to S3/s2idle cycles. Don't grep. Look at the context resp. the tail (while trying to swapoff)
Edit: Do you run into the same problem after a reboot?
Last edited by seth (2025-07-16 14:23:49)
Online
So it's hanging in https://man.archlinux.org/man/swapoff.2.en (the system call) and swapon shows it still in use (despite vmstat) - btw. how and why is is always at 11,6MB?
Is this still the same instance (ie. there're pot. multiple hanging swapoff calls)?
Do you run into the same problem after a reboot?(Also, not sure what to make out of that, but while si and so drop, swpd actually stays at the value)
I have only 1 swapoff process, if I open the next ones, then I close the old ones (When I close them, the swap returns back as i never attempted to swapoff)
Ye, grep was a mistake there is nothing like a pattern that i saw
Last edited by xy1vro4 (2025-07-16 14:53:43)
Offline
[ 6.269982] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS [31314.700484] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS [79323.986643] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS [94240.327687] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS
could easily corrrespond to S3/s2idle cycles. Don't grep. Look at the context resp. the tail (while trying to swapoff)
seth wrote:Edit: Do you run into the same problem after a reboot?
Ye, grep was a mistake there is nothing like a pattern that i saw.
Whan i attempting "swapoff -a" i see nothing in sudo dmesg --follow,
there is not much actualy after the moment that swap was enabled
[94240.327687] Adding 4193276k swap on /dev/nvme0n1p3. Priority:-2 extents:1 across:4193276k SS
[100020.401462] sysctl (400250): drop_caches: 3
[100327.008938] sysctl (400815): drop_caches: 3
[100354.266622] sysctl (400895): drop_caches: 3
[101253.951462] netlink: 'sing-box': attribute type 22 has an invalid length.
[102845.972322] sysctl (427423): drop_caches: 3
[102847.644957] sysctl (427441): drop_caches: 3
[102848.749999] sysctl (427459): drop_caches: 3
[102849.620964] sysctl (427470): drop_caches: 3
[110114.107027] capability: warning: `gvfsd-admin' uses 32-bit capabilities (legacy support in use)
[113639.656502] sysctl (536415): drop_caches: 3
Last edited by xy1vro4 (2025-07-16 14:58:13)
Offline
Yaaaaay, idk how but it's turned off
idk i just
**sudo sysctl vm.swappiness=100(was 1) -> Open large game -> swap filled on 99% -> close game swap filled 70% -> sudo sysctl vm.drop_caches=3 -> swapoff -a**
and i also closed all programs since i was about to reboot my pc,
but just before reboot i attempted 1 more time swapoff and now it's works just fine, like i can swap on\off back normaly,
In past i tryed to set vm.swappiness=100 but it's doesn't helped me out, i also attempted to close maximum amount of soft in past, idk what i made so it's works now normaly
i don't know how i exit this situation
Thank you alot for help, seth
Now swapoff -a "strace" log looks like this
https://pastebin.com/Yh4hVQpe
i'll try to set vm.swappiness to 35, mb that is something about system behavour on low value of swappiness
And i can't fiend button to close topic, or there is no need to close it
Last edited by xy1vro4 (2025-07-16 16:39:54)
Offline
i'll try to set vm.swappiness to 35, mb that is something about system behavour on low value of swappiness.
You should stay away from swappiness=0/1 anway - despite popular you're not preferring swap over RAM w/ "higher" (moderate) swappiness levels but it controls whether you swap out anonymous pages or drop file caches.
Low swappiness would avoid swap usage in favor of dropping file caches, but it seems an odd cause for the inability to swapoff - have you tried whether this is reproducible?
Online
i'll try to set vm.swappiness to 35, mb that is something about system behavour on low value of swappiness.
You should stay away from swappiness=0/1 anway - despite popular you're not preferring swap over RAM w/ "higher" (moderate) swappiness levels but it controls whether you swap out anonymous pages or drop file caches.
Low swappiness would avoid swap usage in favor of dropping file caches, but it seems an odd cause for the inability to swapoff - have you tried whether this is reproducible?
yes, i just set swappiness=100 -> open game(swap load itself on 90%) -> close it(+-65%) -> after this swapoff -a
and it works again
Offline
'key - mystery solved and solution found, I guess.
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Online
'key - mystery solved and solution found, I guess.
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Sry i just don't see where i can chenge a status of this topic
Today i again reproducible this behaviour, and current method does not helped me
so i just
[Oleg@ArchLinux ~]$ smem -rs swap
PID User Command Swap USS PSS RSS
1859 Oleg /usr/lib/mutter-x11-frames 528 109644 112226 121392
1479 Oleg /usr/bin/Xwayland :0 -rootl 528 146180 169263 200816
782577 Oleg /home/@home/Oleg/.local/sha 180 447604 460718 500488
782555 Oleg /proc/self/exe --type=utili 124 15940 19095 36368
782493 Oleg ./steamwebhelper -nocrashdi 56 211076 224649 269396
854124 Oleg python /usr/bin/smem -rs sw 0 22384 23129 28256 "
And than i killed two first process, that halped
Offline
Mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
You're not gonna be able to deactivate the swap if you rely on it (though I thought the OOM killer would just step in an kill processes for you…)
Online
Pages: 1