public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Huanpeng Xin <xinhuanpeng9@gmail.com>
Cc: minchan@kernel.org, ngupta@vflare.org, axboe@kernel.dk,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	xinhuanpeng <xinhuanpeng@xiaomi.com>,
	Christoph Hellwig <hch@lst.de>,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Re: [PATCH] zram: set zram bio priority to REQ_PRIO.
Date: Tue, 18 Jul 2023 20:51:39 +0900	[thread overview]
Message-ID: <20230718115139.GC57770@google.com> (raw)
In-Reply-To: <20230718074929.GD955071@google.com>

On (23/07/18 16:49), Sergey Senozhatsky wrote:
> On (23/07/18 15:11), Huanpeng Xin wrote:
> > 
> > When the system memory pressure is high, set zram bio priority
> > to REQ_PRIO can quickly swap zarm's memory to backing device,
> > freeing up more space for zram.


This is not how zram writeback works. The only time you can be sure
that writeback frees memory is when you writeback ZRAM_HUGE objects,
because each such object uses a whole physical page on the zsmalloc
side. In any other case, compressed objects share physical pages that
zsmalloc pages consist of, so writeback simply punches wholes in zspages,
without actually freeing any memory immediately. You either need zspages
to becomes empty after writeback or pool compaction, otherwise writeback
does not save any memory, no matter how fast it works.

  reply	other threads:[~2023-07-18 11:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18  7:11 [PATCH] zram: set zram bio priority to REQ_PRIO Huanpeng Xin
2023-07-18  7:49 ` Sergey Senozhatsky
2023-07-18 11:51   ` Sergey Senozhatsky [this message]
2023-07-20  8:34   ` Christoph Hellwig

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=20230718115139.GC57770@google.com \
    --to=senozhatsky@chromium.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=xinhuanpeng9@gmail.com \
    --cc=xinhuanpeng@xiaomi.com \
    /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