Hacker News new | ask | show | jobs
by vlovich123 1861 days ago
That’s not quite accurate. When you’re talking about standby time in suspend-to-ram, RAM refresh is actually a non-trivial battery cost because it’s basically you’re only active power draw remaining. Which DIMMs have active memory pages is a partial function of memory usage.

So if your kernel woke up (let’s say after 30 min of suspend to ram) to try and see if it can reclaim physical DIMMs and mark them unused (shrink caches, reorganize pages, etc) you could get quite a big win on standby time. The trick is how to do this without actually hurting battery life (waking up can be expensive and there’s no guarantee you’ll be able to free up DIMMs) and preserving wake from suspend performance (if you’re phone is laggy on wake that’s an experience users will switch away from + you could eat your entire power savings paging back in).

2 comments

Is the memory controller aware of unused pages in physical RAM that thus can be safely skipped during refresh? That would surprise me. In stand-by the self-refresh mode is used, and I believe partial refresh is only supported by the low-power (LPDDRx) standards and is very coarse-grained.
No. What I heard proposed was just at the DIMM level. The memory controller has no concept of memory usage.
The refresh costs you are talking about are what I meant by the RAM has cost by being installed on a typical laptop. The power is used because the machine is in an active-idle power state with that much RAM installed, not because the OS has decided to burn more CPU time in the presence of more RAM as someone suggested earlier in the chain. Most of the idle power consumption is all the ancillary system controllers, not the CPU cores themselves. These are the things that are better managed on a typical smartphone SoC platform.

And, I am referring to active idle, not suspend-to-ram scenarios. I think people are talking about screen-on time for battery life, not lid closed and suspended nor lid open but screen disabled. Precious few people are enjoying a laptop that successfully performs a suspend to RAM sleep state while keeping the display alive. Often, the integrated GPU is continuously scanning framebuffers in system RAM and outputting pixel data to the embedded display port even though nothing is changing on screen. Frequently, drivers have disabled LCD panel self refresh modes due to unresolved glitches and artifacts in the graphics stack.

Yup. One of the major reasons cell phones outperform laptops on battery life is because they go to suspend to RAM aggressively. I think a similarly aggressive mode would be needed for laptops on battery power to compete effectively (& might require OS optimizations to make the wake scenario to be as instant as it is on mobile).