You are not logged in.

#1 2023-05-11 17:55:47

shuruper
Member
Registered: 2020-06-21
Posts: 67

[Solved] Issues with hibernation

Hi,

I have some issues with hibernation. It does work right after reboot, or shortly after. It might also work when I haven't used the system heavily, but it will likely stop working ("not enough swap space" error message appears) after some usage even if everything is closed and "free -h" command suggests that swapfile is not in use.
So I'm having a swapfile for a while (4+ months on this system), I can't trace back exactly when this issue started, probably <1 month ago.
Recently, there was a thread about something similar (https://bbs.archlinux.org/viewtopic.php?id=285469) - this is not, afaik, what is happening here as hibernate does work after restart.

Swapfile and hibernation were configured according to archwiki.
from /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=/dev/nvme1n1p2 resume_offset=9482240 loglevel=3"

As was suggested in that similar thread (https://bbs.archlinux.org/viewtopic.php?id=285469) I'm showing output of these:

$ findmnt -no MAJ:MIN -T /swapfile
259:10 
$ grep . /sys/power/resume*
/sys/power/resume:259:10
/sys/power/resume_offset:9482240

Also about the correctness of UUID used.

$ findmnt -no UUID -T /swapfile
a4df3545-a230-4fe4-8c09-6ed154d688b1

$ sudo lsblk -o NAME,UUID,MOUNTPOINT
NAME        UUID                                 MOUNTPOINT
nvme1n1                                          
├─nvme1n1p1 B33C-6C8F                            
├─nvme1n1p2 a4df3545-a230-4fe4-8c09-6ed154d688b1 /
└─nvme1n1p3 411574bc-4210-4585-a6e3-6a5280882efc /home

I do have additional issues with hibernation: after waking up from hibernation, cursor can't be controlled by a touchpad - moves randomly and only restart helps. It might be that this issue caused by the previous so probably it would be better to fix it first and open another thread for this one if it persists.

Thanks for your help!

Last edited by shuruper (2023-11-01 18:46:08)

Offline

#2 2023-05-11 20:22:33

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,784

Re: [Solved] Issues with hibernation

"free -h" command suggests that swapfile is not in use

How big is the swap file and how much memory is in use when this happens?

cat /proc/meminfo

Does dropping the caches at this point help?

echo 3 | sudo tee /proc/sys/vm/drop_caches

Offline

#3 2023-05-12 10:03:01

Paria Stark
Member
Registered: 2023-05-12
Posts: 6

Re: [Solved] Issues with hibernation

shuruper wrote:

I do have additional issues with hibernation: after waking up from hibernation, cursor can't be controlled by a touchpad - moves randomly and only restart helps. It might be that this issue caused by the previous so probably it would be better to fix it first and open another thread for this one if it persists.

I have the exact same issue, Dell XPS 9510, i3 started with GDM, libinput, hibernation into ext4 swap file.

It started happening a few days/weeks ago, could not pinpoint the exact trigger. I used to work perfectly.

If anybody has any idea how to troubleshoot I would be so glad.

Last edited by Paria Stark (2023-05-12 10:03:37)

Offline

#4 2023-05-12 14:03:26

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

seth, thanks for helping.

My swap file is slightly above my RAM (32Gb).

$ cat /proc/meminfo
MemTotal:       32532148 kB
MemFree:        26170388 kB
MemAvailable:   28028600 kB
Buffers:          253616 kB
Cached:          3233692 kB
SwapCached:            0 kB
Active:          3255092 kB
Inactive:         715932 kB
Active(anon):    1972392 kB
Inactive(anon):    19352 kB
Active(file):    1282700 kB
Inactive(file):   696580 kB
Unevictable:     1458448 kB
Mlocked:               0 kB
SwapTotal:      33554428 kB
SwapFree:       33554428 kB

I tried to replicate this hibernation issue, but wasn't successful yet so I'll report later if dropping the caches works.
1 thing for sure, it doesn't help with "random cursor".

Offline

#5 2023-05-12 14:31:46

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

Paria Stark wrote:
shuruper wrote:

I do have additional issues with hibernation: after waking up from hibernation, cursor can't be controlled by a touchpad - moves randomly and only restart helps. It might be that this issue caused by the previous so probably it would be better to fix it first and open another thread for this one if it persists.

I have the exact same issue, Dell XPS 9510, i3 started with GDM, libinput, hibernation into ext4 swap file.

It started happening a few days/weeks ago, could not pinpoint the exact trigger. I used to work perfectly.

If anybody has any idea how to troubleshoot I would be so glad.

Thanks for your report, I think now it is safe to assume that "random cursor" issue after hibernation has no relation to my issue with hibernation itself (not working properly). I'll make new thread after this one will be resolved (hopefully) or you can go ahead and create it yourself.

Offline

#6 2023-05-12 14:59:13

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,784

Re: [Solved] Issues with hibernation

Wrt the cursor: @shuruper, Do you have a Dell XPS 9510 as well?


The device seems to have a touchpad and a touchscreen?
What if you disable either or the other w/ xinput?

Offline

#7 2023-05-12 15:53:53

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

seth wrote:

Wrt the cursor: @shuruper, Do you have a Dell XPS 9510 as well?

I have xps 9520, which is 1 year ahead and different CPU (mine has i7-12700H).

The device seems to have a touchpad and a touchscreen?
What if you disable either or the other w/ xinput?

Yes, I have both touchpad and touchscreen. I've tried to disable/reenable them to no avail.

Also, I do have the hibernation issue right now:

$ systemctl hibernate
Call to Hibernate failed: Not enough swap space for hibernation
$ free -h
               total        used        free      shared  buff/cache   available
Mem:            31Gi       4.5Gi        22Gi       3.1Gi       4.0Gi        22Gi
Swap:           31Gi          0B        31Gi

dropping the caches doesn't help.

Last edited by shuruper (2023-05-12 15:54:55)

Offline

#8 2023-05-12 18:27:52

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,784

Re: [Solved] Issues with hibernation

That's too much RAM - is the swapfile on a btrfs partition?

Offline

#9 2023-05-12 19:46:51

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

seth wrote:

That's too much RAM - is the swapfile on a btrfs partition?

No, it is not. I'm not aware of this being an issue. Probably I should familiarize myself now.

Offline

#10 2023-05-12 20:37:13

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,784

Re: [Solved] Issues with hibernation

There're some caveats. It's not a problem per se.
https://wiki.archlinux.org/title/Btrfs#Swap_file

However, that's apparently not relevant.

This is a notebook? On battery? Does the charge matter?
Nvidia? Do you use https://download.nvidia.com/XFree86/Lin … ement.html ?

Offline

#11 2023-05-12 21:21:08

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

This is a notebook? On battery? Does the charge matter?
Nvidia? Do you use https://download.nvidia.com/XFree86/Lin … ement.html ?

It is a laptop and this happens both while on AC and on battery so that charge doesn't matter. Nvidia, yes (rtx 3050 ti) . I do not use this nvidia driver for hibernation though.

Offline

#12 2023-05-13 20:28:14

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,784

Re: [Solved] Issues with hibernation

Something bogus here?

cat /sys/power/image_size

https://wiki.archlinux.org/title/Power_ … /file_size

Offline

#13 2023-05-13 21:06:51

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

I don't see anything weird here.

$ cat /sys/power/image_size
13318430720

Offline

#14 2023-05-13 21:37:46

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,784

Re: [Solved] Issues with hibernation

At least 12.4GB is way below the availaible swap and way above the used RAM.

What's the output of

swapon

Offline

#15 2023-05-13 21:56:01

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

I should have clarified that I've rebooted the system so it is not now in a "error hibernation" state. However, as I've tried those before, it stays the same as if no error is present.

$ swapon
NAME      TYPE SIZE USED PRIO
/swapfile file  32G   0B   -2

I'll see the output from those when hibernate doesn't work and post its output later.

Offline

#16 2023-05-16 13:40:17

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

Now I'm posting the output while having this issue again.

$ systemctl hibernate
Call to Hibernate failed: Not enough swap space for hibernation
$ swapon
NAME      TYPE SIZE USED PRIO
/swapfile file  32G   0B   -2
$ cat /sys/power/image_size
13318434816

Offline

#17 2023-05-16 14:50:34

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,784

Re: [Solved] Issues with hibernation

There's no 2nd swap device w/ higher priority and the image_size is a teenytinybit bigger, but still no problem.
No idea why systemd thinks this is bad.

You can try https://github.com/systemd/systemd/issu … -691622992 but iff there is an actual reason to prevent the hibernation, the resume may fail and you'll lose all volatile data.
So you should only do that if you're prepared for that.

Offline

#18 2023-05-16 14:52:26

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 710

Re: [Solved] Issues with hibernation

Try to hibernate via the kernel's interface:

# echo disk > /sys/power/state

If that works, then this may be a bug in logind.

Offline

#19 2023-05-16 23:08:18

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

seth wrote:

You can try https://github.com/systemd/systemd/issu … -691622992 but iff there is an actual reason to prevent the hibernation, the resume may fail and you'll lose all volatile data.
So you should only do that if you're prepared for that.

I'll try that. Hope by "volatile data" you meant data stored in RAM or swap.

nl6720 wrote:

Try to hibernate via the kernel's interface:

# echo disk > /sys/power/state
If that works, then this may be a bug in logind.

To try it I needed root, sudo wasn't enough (is this behavior expected?), but it still failed.

# echo disk > /sys/power/state
bash: echo: write error: No such device

After entering "echo disk..." command system freezes, then screen goes black with blinking cursor, than screen is black as if hibernated successfully, but then it goes back, unfreezes and throws this error (above). This time, however, journalctl does have something to say (https://0x0.st/HNgv.txt).
Not sure if it supposed to work though ..

Offline

#20 2023-05-17 02:03:19

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,601

Re: [Solved] Issues with hibernation

shuruper wrote:
# echo disk > /sys/power/state
If that works, then this may be a bug in logind.

To try it I needed root, sudo wasn't enough (is this behavior expected?), but it still failed.

Assuming you tried sudo echo disk > /sys/power/state,  that won't work.  The sudo applies only to echo disk
when it hits the redirect ( '>' ), privilege reverts to that of the user, and the user cannot write to /sys/power/state.

You might try:
sudo bash -c "echo disk > /sys/power/state"
That will invoke bash, with privileges of root,  to run the quoted command in its entirety without yielding privilege at the redirect .


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#21 2023-05-17 05:11:02

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,784

Re: [Solved] Issues with hibernation

May 16 18:55:56 archXPS kernel: PM: Cannot get swap writer
May 16 18:55:56 archXPS kernel: PM: Cannot find swap device, try swapon -a

So something™ happens to the swapfile, if
- it's not btrfs and
- it's not dmcrypt and
- it's not the unstable device name (nvme1n1p2)
=> my money is on the nvme…
https://wiki.archlinux.org/title/Solid_ … leshooting

Offline

#22 2023-07-17 11:38:05

Paria Stark
Member
Registered: 2023-05-12
Posts: 6

Re: [Solved] Issues with hibernation

shuruper wrote:
Paria Stark wrote:
shuruper wrote:

I do have additional issues with hibernation: after waking up from hibernation, cursor can't be controlled by a touchpad - moves randomly and only restart helps. It might be that this issue caused by the previous so probably it would be better to fix it first and open another thread for this one if it persists.

I have the exact same issue, Dell XPS 9510, i3 started with GDM, libinput, hibernation into ext4 swap file.

It started happening a few days/weeks ago, could not pinpoint the exact trigger. I used to work perfectly.

If anybody has any idea how to troubleshoot I would be so glad.

Thanks for your report, I think now it is safe to assume that "random cursor" issue after hibernation has no relation to my issue with hibernation itself (not working properly). I'll make new thread after this one will be resolved (hopefully) or you can go ahead and create it yourself.


Hey, just checking in before making a dedicated post. Have you made any progress on the touchpad after hibernation issue ?

Last edited by Paria Stark (2023-07-17 11:38:16)

Offline

#23 2023-07-28 22:14:19

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

Paria Stark,

no, I haven't. I've tried what seth suggested (https://wiki.archlinux.org/title/Solid_ … leshooting) and not sure about hibernation itself (no memory issue - will keep monitoring after updating kernel parameters), but jittery touchpad this solution doesn't heal.

Offline

#24 2023-07-29 06:59:49

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,784

Re: [Solved] Issues with hibernation

Does either of you dual boot windows, btw?
Seen https://wiki.archlinux.org/title/Dell_X … uchpad_lag ?
Can you reliably control the cursor w/ the touchscreen when the touchpad doesn't work?

Offline

#25 2023-08-23 14:31:51

shuruper
Member
Registered: 2020-06-21
Posts: 67

Re: [Solved] Issues with hibernation

ok, so the actual situation is the following: Hibernation is not usable on my Dell XPS 15 9520 laptop largely due to touchpad is unusable after waking up. I can't confirm that "not enough swap space" issue was resolved, but I haven't seen it lately. I will be checking more and update on the matter. The only thing here I haven't tried is placing swapfile somewhere else physically, but I'm not sure if it is worth a try.

I have seen the link (lagging touchpad), but this is not what I have, because my touchpad isn't laggy, it literally lives its own life whenever I touch it (happens exclusively after waking up from hibernation, suspend to RAM works fine). I can control the position of the cursor via touchscreen, but I can't click. i.e., touching the screen only moves the cursor around.

I am dual booting windows 11 (separate physical drive).

Offline

Board footer

Powered by FluxBB