-
Notifications
You must be signed in to change notification settings - Fork 0
zram: introduce compressed data writeback #411
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
Conversation
|
Upstream branch: c2f2b01 |
ec9caac to
4a5ddea
Compare
zram stores all written back slots raw, which implies that during writeback zram first has to decompress slots (except for ZRAM_HUGE slots, which are raw already). The problem with this approach is that not every written back page gets read back (either via read() or via page-fault), which means that zram basically wastes CPU cycles and battery decompressing such slots. This changes with introduction of decompression on demand, in other words decompression on read()/page-fault. One caveat of decompression on demand is that async read is completed in IRQ context, while zram decompression is sleepable. To workaround this, read-back decompression is offloaded to a preemptible context - system high-prio work-queue. At this point compressed writeback is still disabled, a follow up patch will introduce a new device attribute which will make it possible to toggle compressed writeback per-device. [senozhatsky: rewrote original implementation] Signed-off-by: Richard Chang <[email protected]> Co-developed-by: Sergey Senozhatsky <[email protected]> Suggested-by: Minchan Kim <[email protected]> Suggested-by: Brian Geffon <[email protected]>
Introduce witeback_compressed device attribute to toggle compressed writeback (decompression on demand) feature. [senozhatsky: rewrote original patch, added documentation] Signed-off-by: Richard Chang <[email protected]> Co-developed-by: Sergey Senozhatsky <[email protected]>
Add missing writeback_batch_size documentation. Signed-off-by: Sergey Senozhatsky <[email protected]>
Move bd_stat function and attribute declaration to existing CONFIG_WRITEBACK ifdef-sections. Signed-off-by: Sergey Senozhatsky <[email protected]>
We don't free page in zram_free_page(), not all slots even have any memory associated with them (e.g. ZRAM_SAME). We free the slot (or reset it), rename the function accordingly. Signed-off-by: Sergey Senozhatsky <[email protected]>
Use init_lock guard() in sysfs store/show handlers, in order to simplify and, more importantly, to modernize the code. While at it, fix up more coding styles. Signed-off-by: Sergey Senozhatsky <[email protected]>
Do not spread device attributes declarations across the file, move io_stat, mm_stat, debug_stat to a common device-attr section. Signed-off-by: Sergey Senozhatsky <[email protected]>
|
Upstream branch: d26143b |
f780a21 to
5646e3c
Compare
|
Upstream branch: d26143b |
1 similar comment
|
Upstream branch: d26143b |
|
Github failed to update this PR after force push. Close it. |
Pull request for series with
subject: zram: introduce compressed data writeback
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1029165