-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: Actually use the writeback device #164
Comments
AIUI, and the kernel documentation appears to agree with this, both |
@nabijaczleweli You are right. So if we want to use zram idle pages writeback feature, we need a daemon which automatically marks all pages as idle and flush them later, like this: https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/ZramWriteback.java |
@joebonrichie They are not options but commands. |
Thanks, I misunderstood the documentation initially. It looks like systemd timers are the way to go, you may want to check if |
@joebonrichie If we use timers to mark idle pages and write them back, |
Also, we may need a mechanism to automatically write back |
What i mean is; for example: if a systemd timer is setup to write to the writeback every ten minutes. Without |
@joebonrichie According to the Android implemention, we should have a much long delay after marking and then write back. For example, the Android implemention first marks all pages, delays 24 hours, and then flushes idle pages and marks all pages again, thus it don't need |
@nabijaczleweli What do you think about this? |
I agree: this is very work-load dependent, and you can write a timer that matches your work-load. (Frankly, exposing the backing device setup was a bit of a mistake, and pointing it out in the default config more so still.) |
@nabijaczleweli However, the timer can not define a condition that triggers the writeback when a system is under memory pressure (e.g. when available memory is less than 10%). |
Okay? 9G free is more than fine, so I don't know why you'd want that. |
@nabijaczleweli I mean that if you start an application that occupies a lot of memory, there should be a mechanism to reclaim memory like what zswap does. |
Hey i would like to know if my systemd-timer and systemd-service units would work right. |
After assigning a writeback device, it is not used unless a command is given to write to it.
Following the upstream documentation: https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html#writeback
If we:
Then backing device stats reports
Upstream provides three commands to write to the writeback device.
CONFIG_ZRAM_MEMORY_TRACKING
for time granularity)For personal computer use probably idle+huge makes the most sense and idle if <5.19.
It would be nice if zram-generator could default to some options and periodically tell zram to write to the the writeback device based on either a timer and/or some simple heuristics.
The text was updated successfully, but these errors were encountered: