linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Barry Song <21cnbao@gmail.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: 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: Tue, 6 Sep 2022 09:27:08 +1200	[thread overview]
Message-ID: <CAGsJ_4x5zGNydNm_3YxdQOAiVhKE4XRStwwHPeQHF7kfeP=iJA@mail.gmail.com> (raw)
In-Reply-To: <YxXM0PwVEghPF9hg@google.com>

On Mon, Sep 5, 2022 at 10:17 PM Sergey Senozhatsky
<senozhatsky@chromium.org> wrote:
>
> 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/

Thanks very much. I guess the difficulty is that we need to
comprehensively evaluate its
effect on a real product such as android. there is always a trade-off
between cpu utilization
and more available memory.

Best Regards
Barry


  reply	other threads:[~2022-09-05 21:27 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
2022-09-05 21:27           ` Barry Song [this message]
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
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='CAGsJ_4x5zGNydNm_3YxdQOAiVhKE4XRStwwHPeQHF7kfeP=iJA@mail.gmail.com' \
    --to=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 \
    --cc=senozhatsky@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox