Saturday, April 20, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 77786  / 3 Years ago, tue, may 25, 2021, 4:12:47

  1. What the hell are they? how are they different (I've written my understanding in an answer below)

  2. In the Zswap system, when a page is evicted from the zswap to the actual swap is it stored in a compressed from? (or is it decompressed before storing?, AFAICT it is still compressed but i can't be sure)

  3. What is the current state of zcache? it was apparently removed or something in 3.11. What does this mean? (http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=96256460487387d28b8398033928e06eb9e428f7)


More From » kernel

 Answers
4

Regarding 2., zswap does seem to decompress the pages on write-back,
confirming @Cbhihe's comment.


mm/zswap.c, line 828:


/*
* Attempts to free an entry by adding a page to the swap cache,
* decompressing the entry data into the page, and issuing a
* bio write to write the page back to the swap device.
* ...
*/
static int zswap_writeback_entry(struct zpool *pool, unsigned long handle)
{
...

case ZSWAP_SWAPCACHE_NEW: /* page is locked */
/* decompress */
...

ret = crypto_comp_decompress(tfm, src, entry->length,
dst, &dlen);
...
kunmap_atomic(dst);


$ git show
commit 1573d2caf713874cfe0d1336c823d0fb548d8bed
Merge: 4cdf8db 0a86248
Author: Linus Torvalds <[email protected]>
Date: Tue Oct 11 23:59:07 2016 -0700

So zswap is useful for situations where the compressed in-ram cache is
likely to be forgotten soon before written back to disk.
It is not for applications with large, long
living heaps that will eventually need to be backed by the actual swap device.


[#25010] Tuesday, May 25, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
herriail

Total Points: 11
Total Questions: 122
Total Answers: 118

Location: Peru
Member since Tue, Mar 16, 2021
3 Years ago
herriail questions
Tue, May 18, 21, 02:11, 3 Years ago
Sun, Dec 12, 21, 06:06, 2 Years ago
Wed, May 24, 23, 01:42, 12 Months ago
Sun, Jan 29, 23, 00:48, 1 Year ago
;