archive mirror
 help / color / mirror / Atom feed
From: Greg KH <>
Subject: Re: [RFC PATCH V3] zram:calculate available memory when zram is used
Date: Tue, 8 Jun 2021 11:29:18 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, Jun 07, 2021 at 08:39:14AM -0700, wrote:
> From: wangyong <>
> When zram is used, available+Swap free memory is obviously bigger than we
> actually can use, because zram can compress memory by compression
> algorithm and zram compressed data will occupy memory too.
> So, we can count the compression ratio of zram in the kernel. The space
> will be saved by zram and other swap device are calculated as follows:
> zram[swapfree - swapfree * compress ratio] + swapdev[swapfree]
> We can evaluate the available memory of the whole system as:
> MemAvailable+zram[swapfree - swapfree * compress ratio]+swapdev[swapfree]

Why is this needed to be exported by userspace?  Who is going to use
this information and why can't they just calculate it from the exported
information already?

What tool requires this new information and what is it going to be used

And why add a block driver's information to a core proc file?  Shouldn't
the information only be in the block driver's sysfs directory only?


greg k-h

  parent reply	other threads:[~2021-06-08  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 15:39 [RFC PATCH V3] zram:calculate available memory when zram is used yongw.pur
2021-06-08  9:28 ` Greg KH
2021-06-09 14:58   ` yong w
2021-06-08  9:29 ` Greg KH [this message]
2021-06-09 14:23   ` yong w
2021-06-09 14:59     ` Greg KH

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).