Indeed.Thistled wrote:Might not be the right suggestion to offer but....
If you suspend, then a trickle of power is required to keep the data stored in the RAM, in time it will drain the battery.
Therefore I would hibernate (to disk) instead of suspending.
This will save the current state of the OS to disk, and power off the system completely, which in turn will prevent the battery drain.
Last time I looked you state in the kernel config which /dev/sd* you hibernate to.
Hope this helps.
None of the above. You can't "edit" the file. It's not a file as you imagine it. The problem might be kernel support or one of those laptops with the crappy M$ $hit connected standby. What's your exact laptop model?juniper wrote:Hello,
I've got massive battery drain issues while the computer is sleeping.
I came across this ubuntu thread
https://askubuntu.com/questions/1398674 ... in-8-hours
The file /sys/power/mem_sleep exists on my gentoo machine and its only contents are [s2idle]. The trouble is I am not sure what the fix is. Do I edit the file and replace with
[deep]
or
[s2idle] deep
???
Code: Select all
freeze mem disk
Code: Select all
[s2idle]
Code: Select all
write: invalid argument
You can't do that, this is not an ordinary file. If the option is not present when reading, you can't write it. This file is directly related to a device driver. It's a character device.juniper wrote: if I try as root, I get an error
Code: Select all
write: invalid argument
I think you're screwed. Try finding something related in the bios or try downgrading the EFI firmware, but I think Intel stopped implementing this functionality on the chipset level.juniper wrote:@georgi: My laptop is Lenovo 20Y30065US. I am having trouble compiling a custom kernel, so I am using gentoo-kernel-bin. Pretty generic I think.
EDIT: This user's post suggests there is an S3 sleep option in the bios, if you're lucky you'll find it.https://www.kernel.org/doc/Documentation/power/states.txt wrote: State: Suspend-To-Idle
ACPI state: S0
Label: "s2idle" ("freeze")
This state is a generic, pure software, light-weight, system sleep state.
It allows more energy to be saved relative to runtime idle by freezing user
space and putting all I/O devices into low-power states (possibly
lower-power than available at run time), such that the processors can
spend more time in their idle states.
This state can be used for platforms without Power-On Suspend/Suspend-to-RAM
support, or it can be used in addition to Suspend-to-RAM to provide reduced
resume latency. It is always supported.
Unfortunately that appears to be true. I believe I've read devices were abandoning "real" power management features so they can remain on with network connectivity.juniper wrote:@pjp: I think I can't do that because my configuration doesn't support it.
(101 pages) https://download.lenovo.com/pccbbs/mobi ... hmm_en.pdfPower management
To reduce power consumption, the computer has three power management modes: screen blank, sleep, and
hibernation.
Sleep mode
When the computer enters sleep mode, the screen goes blank and all internal devices are still powered on
with lower power consumption
Hibernation mode
In hibernation mode, the following occurs:
• The system status, RAM, VRAM, and setup data are stored on the hard disk.
• The system is powered off.
Hey Georgi,logrusx wrote: EDIT: This user's post suggests there is an S3 sleep option in the bios, if you're lucky you'll find it.
Best Regards,
Georgi
Code: Select all
s2idle [deep]
Code: Select all
[64071.428750] elogind-daemon[2029]: Suspending system...
[64071.428760] PM: suspend entry (deep)
[64071.455827] Filesystems sync: 0.027 seconds
[64071.456196] Loading firmware: i915/tgl_dmc_ver2_12.bin
[64071.456279] Loading firmware: iwlwifi-ty-a0-gf-a0-72.ucode
[64071.456353] Loading firmware: iwlwifi-ty-a0-gf-a0.pnvm
[64071.456746] Loading firmware: regulatory.db
[64071.456860] Loading firmware: regulatory.db.p7s
[64071.456884] Loading firmware: intel/sof/sof-tgl-h.ri
[64071.456887] Loading firmware: intel/sof-tplg/sof-hda-generic-2ch.tplg
[64071.458025] Freezing user space processes
[64071.474084] Freezing user space processes completed (elapsed 0.016 seconds)
[64071.474093] OOM killer disabled.
[64071.474096] Freezing remaining freezable tasks
[64071.475456] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[64071.475584] printk: Suspending console(s) (use no_console_suspend to debug)
[64072.882162] PM: suspend devices took 1.407 seconds
[64072.902782] ACPI: EC: interrupt blocked
[64073.237220] ACPI: PM: Preparing to enter system sleep state S3
[64073.255370] ACPI: EC: event blocked
[64073.255372] ACPI: EC: EC stopped
[64073.255373] ACPI: PM: Saving platform NVS memory
[64073.255633] Disabling non-boot CPUs ...
[64073.257350] smpboot: CPU 1 is now offline
[64073.262383] smpboot: CPU 2 is now offline
[64073.266834] smpboot: CPU 3 is now offline
[64073.271466] smpboot: CPU 4 is now offline
[64073.276312] smpboot: CPU 5 is now offline
[64073.281346] smpboot: CPU 6 is now offline
[64073.287073] smpboot: CPU 7 is now offline
[64073.293569] smpboot: CPU 8 is now offline
[64073.299256] smpboot: CPU 9 is now offline
[64073.301305] smpboot: CPU 10 is now offline
[64073.303205] smpboot: CPU 11 is now offline
[64073.305315] smpboot: CPU 12 is now offline
[64073.307438] smpboot: CPU 13 is now offline
[64073.309521] smpboot: CPU 14 is now offline
[64073.311636] smpboot: CPU 15 is now offline
[64073.316373] ACPI: PM: Low-level resume complete
[64073.316443] ACPI: EC: EC started
[64073.316444] ACPI: PM: Restoring platform NVS memory
[64073.317431] Enabling non-boot CPUs ...
[64073.317476] x86: Booting SMP configuration:
[64073.317477] smpboot: Booting Node 0 Processor 1 APIC 0x2
[64073.323802] CPU1 is up
[64073.323830] smpboot: Booting Node 0 Processor 2 APIC 0x4
[64073.327052] CPU2 is up
[64073.327073] smpboot: Booting Node 0 Processor 3 APIC 0x6
[64073.330266] CPU3 is up
[64073.330285] smpboot: Booting Node 0 Processor 4 APIC 0x8
[64073.333485] CPU4 is up
[64073.333505] smpboot: Booting Node 0 Processor 5 APIC 0xa
[64073.336718] CPU5 is up
[64073.336736] smpboot: Booting Node 0 Processor 6 APIC 0xc
[64073.340069] CPU6 is up
[64073.340101] smpboot: Booting Node 0 Processor 7 APIC 0xe
[64073.343517] CPU7 is up
[64073.343536] smpboot: Booting Node 0 Processor 8 APIC 0x1
[64073.345154] CPU8 is up
[64073.345175] smpboot: Booting Node 0 Processor 9 APIC 0x3
[64073.346785] CPU9 is up
[64073.346804] smpboot: Booting Node 0 Processor 10 APIC 0x5
[64073.348376] CPU10 is up
[64073.348395] smpboot: Booting Node 0 Processor 11 APIC 0x7
[64073.350332] CPU11 is up
[64073.350352] smpboot: Booting Node 0 Processor 12 APIC 0x9
[64073.351929] CPU12 is up
[64073.351949] smpboot: Booting Node 0 Processor 13 APIC 0xb
[64073.353540] CPU13 is up
[64073.353559] smpboot: Booting Node 0 Processor 14 APIC 0xd
[64073.355208] CPU14 is up
[64073.355228] smpboot: Booting Node 0 Processor 15 APIC 0xf
[64073.357154] CPU15 is up
[64073.373556] ACPI: PM: Waking up from system sleep state S3
[64073.403764] ACPI: EC: interrupt unblocked
[64073.679298] ACPI: EC: event unblocked
[64073.694433] xhci_hcd 0000:00:0d.0: xHC error in resume, USBSTS 0x401, Reinit
[64073.694440] usb usb1: root hub lost power or was reset
[64073.694442] usb usb2: root hub lost power or was reset
[64073.707388] nvme nvme0: Shutdown timeout set to 10 seconds
[64073.758827] nvme nvme0: 16/0/0 default/read/poll queues
[64073.942251] usb 3-8: reset high-speed USB device number 2 using xhci_hcd
[64074.120739] PM: resume devices took 0.440 seconds
[64074.124451] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops __SCT__tp_func_intel_frontbuffer_flush [i915])
[64074.124817] OOM killer enabled.
[64074.124818] Restarting tasks ...
[64074.124878] mei_pxp 0000:00:16.0-fbf6fcf1-96cf-4e2e-a6a6-1bab8cbe36b1: bound 0000:00:02.0 (ops __SCT__tp_func_intel_frontbuffer_flush [i915])
[64074.131147] done.
[64074.131198] random: crng reseeded on system resumption
[64074.447331] PM: suspend exit
[64074.447355] elogind-daemon[2029]: System resumed.