All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Barry Song <21cnbao@gmail.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Nitin Gupta <ngupta@vflare.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH RFC 4/7] zram: Introduce recompress sysfs knob
Date: Mon, 5 Sep 2022 19:17:52 +0900	[thread overview]
Message-ID: <YxXM0PwVEghPF9hg@google.com> (raw)
In-Reply-To: <CAGsJ_4zqXJJHA02NzyZ662jfL+sNp3LrErTP18vGz2N4u1Tqiw@mail.gmail.com>

On (22/09/05 22:06), Barry Song wrote:
> 
> make sense! thanks! i assume you will have some benchmark data to compare
> three cases,
> 1. lzo with recompress zstd
> 2. always use lzo
> 3. always use zstd
> 
> such as power consumption, cpu utilization, available memory, benefits to user
> experiences especially to UI smoothness under memory pressure?

So I didn't want to include any benchmarks, because this is entirely
specific to device's data sets/patterns. In term of CPU usage, zstd
decompression is really fast [1]; and the way plan to use is battery
aware - e.g. when low on battery do not recompress at all, if AC is
plugged in then recompress more aggressively, etc.

In term of benchmarks... a copy paste from our internal tests. But
*do note* that this is relative only to our specific data sets.
Your millage may vary.

ZSTD recomp algorithm (5.10 kernel, so the last column is the number of
'zram huge pages'):

- Initial state of zram swap partition
localhost ~ # cat /sys/block/zram0/mm_stat 
8955662336 2180671776 2277711872        0 3179720704   798724   469474   118949

- Recompress HUGE objects only
localhost ~ # echo huge > /sys/block/zram0/recompress 
localhost ~ # cat /sys/block/zram0/mm_stat 
8944390144 2106998658 2211835904        0 3179720704   798617   469474    66821

- Recompress IDLE pages that are >= 3000 bytes in size
localhost ~ # echo 3000 > /sys/block/zram0/recompress 
localhost ~ # cat /sys/block/zram0/mm_stat 
8934166528 2085232505 2207690752        0 3179720704   798484   469474    66811

- Recompress the remaining IDLE pages that are >= 2000 bytes in size
localhost ~ # echo 2000 > /sys/block/zram0/recompress 
localhost ~ # cat /sys/block/zram0/mm_stat 
8913981440 1946488434 2145157120        0 3179720704   798130   469474    66498

- Recompress the remaining IDLE pages that are >= 1000 bytes in size
localhost ~ # echo 1000 > /sys/block/zram0/recompress 
localhost ~ # cat /sys/block/zram0/mm_stat 
8905592832 1711533182 1984495616        0 3179720704   797162   469474    66222

[1] https://facebook.github.io/zstd/


  reply	other threads:[~2022-09-05 10:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05  8:15 [PATCH RFC 0/7] zram: Support multiple compression streams Sergey Senozhatsky
2022-09-05  8:15 ` [PATCH 1/3] documentation: Add recompression documentation Sergey Senozhatsky
2022-09-05  8:15 ` [PATCH RFC 1/7] zram: Preparation for multi-zcomp support Sergey Senozhatsky
2022-09-05  8:15 ` [PATCH 2/3] zram: Add recompression algorithm choice to Kconfig Sergey Senozhatsky
2022-09-05  8:15 ` [PATCH RFC 2/7] zram: Add recompression algorithm sysfs knob Sergey Senozhatsky
2022-09-05  8:15 ` [PATCH 3/3] zram: Add recompress flag to read_block_state() Sergey Senozhatsky
2022-09-05  8:15 ` [PATCH RFC 3/7] zram: Factor out WB and non-WB zram read functions Sergey Senozhatsky
2022-09-05  8:15 ` [PATCH RFC 4/7] zram: Introduce recompress sysfs knob Sergey Senozhatsky
2022-09-05  9:21   ` Barry Song
2022-09-05  9:53     ` Sergey Senozhatsky
2022-09-05 10:06       ` Barry Song
2022-09-05 10:17         ` Sergey Senozhatsky [this message]
2022-09-05 21:27           ` Barry Song
2022-09-05  8:15 ` [PATCH RFC 5/7] documentation: Add recompression documentation Sergey Senozhatsky
2022-09-05  8:15 ` [PATCH RFC 6/7] zram: Add recompression algorithm choice to Kconfig Sergey Senozhatsky
2022-09-05  8:15 ` [PATCH RFC 7/7] zram: Add recompress flag to read_block_state() Sergey Senozhatsky
2022-09-05  8:21 ` [PATCH RFC 0/7] zram: Support multiple compression streams Sergey Senozhatsky
  -- strict thread matches above, loose matches on Subject: below --
2022-09-05  8:23 Sergey Senozhatsky
2022-09-05  8:23 ` [PATCH RFC 4/7] zram: Introduce recompress sysfs knob Sergey Senozhatsky
2022-09-12 10:05   ` Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YxXM0PwVEghPF9hg@google.com \
    --to=senozhatsky@chromium.org \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.