4 ms·
Google added this to the Linux kernel quite some time ago for Android. Basically, it inserts a step before the "move to swap" step where it compresses the page
by DiabloD3 13y ago
Google added this to the Linux kernel quite some time ago for Android.
Basically, it inserts a step before the "move to swap" step where it compresses the page. This a) allows Linux to write a compressed page to swap which allows both faster writes but also faster reads, b) allows you to use more memory before hitting swap.
Major distros are considering enabling this functionality in their kernels by default.
What you're describing sounds like samepage detection, which Linux also has thanks to Google and Android.
- asveikau 13y agoI guess what it costs you in CPU is easily regained by what it saves you in I/O.
- calinet6 13y agoYes, it would seem to be more efficient all around. One of those "why didn't I think of that?" things that sounds really simple and nice in hindsight.
- sciurus 13y agoAre you sure Google gets the credit for this? Memory compression still hasn't been merged into mainline linux; right now it's looking like zswap will make it into 3.11. I think zswap was developed by IBM. I think kernel samepage merging was developed by Red Hat. https://lwn.net/Articles/551401/ https://lwn.net/Articles/551401/ https://lwn.net/Articles/545244/ https://lwn.net/Articles/545244/ https://lwn.net/Articles/330589/ https://lwn.net/Articles/330589/