Re:Linux 3.11's feature set now confirmed
by bodyfour on Tuesday July 16, 2013 @03:17PM
(#6054120)
As others have pointed out, the point of zswap is to "swap" in and out of RAM.
I'd like to add that your premise is faulty anyway: since compressed objects are smaller doing I/O on them is faster. As long as cost of the I/O you saved is less than the cost of doing the compression, it's faster not slower. Transparently compressed I/O usually uses high-speed algorithms (LZ4, LZO, etc) to take advantage of this effect.
Also, when a machine is swapping you'll usually find that the CPU is near idle since useful work is blocked on the swap I/O. Spending a little CPU time to speed up that I/O is a win.
I'd like to add that your premise is faulty anyway: since compressed objects are smaller doing I/O on them is faster. As long as cost of the I/O you saved is less than the cost of doing the compression, it's faster not slower. Transparently compressed I/O usually uses high-speed algorithms (LZ4, LZO, etc) to take advantage of this effect.
Also, when a machine is swapping you'll usually find that the CPU is near idle since useful work is blocked on the swap I/O. Spending a little CPU time to speed up that I/O is a win.