Linux-mm Archive mirror
 help / color / mirror / Atom feed
From: <long.yunjian@zte.com.cn>
To: <linux-mm@kvack.org>
Cc: <chen.jinhao@zte.com.cn>, <wang.liang82@zte.com.cn>,
	<jiang.xuexin@zte.com.cn>, <jiang.yong5@zte.com.cn>
Subject: INQUIRIES about MemAvailable calculation methods
Date: Mon, 13 May 2024 09:49:04 +0800 (CST)	[thread overview]
Message-ID: <20240513094904033EDcCrUwr6SiEbZC4kH08i@zte.com.cn> (raw)

Hello, everyone,

I hope this email finds you well. I am a kernel developer and have been very
interested in memory management and related data statistics recently. I
noticed that there is a property called MemAvailable in /proc/meminfo. It is
indeed helpful to estimated the available memory of my machine. Out of curiosity,
however,  I would like to inquire about some details with you:

> Currently, the amount of memory that is available for a new workload,
> without pushing the system into swap, can be estimated from MemFree,
> Active(file), Inactive(file), and SReclaimable, as well as the "low"
> watermarks from /proc/zoneinfo.
1. As described in patch 34e431b0ae398fc54ea69ff85ec700722c9da773, the estimation
   of MemAvaild takes `without pushing the system into swap` into account.
   Is this for performance consideration?
2. when I raise the memory watermark through /proc/sys/vm/watermark_scale_factor,
   the value of MemAvailable sharply decreases. After investigation, this decreasement
   mainly comes from the adjustment of mem watermark. Why shuoud we take the
   change of mem watermark into consideration? Is it also for performance
   consideration? Why the performance loss must be considered even for embedded
   devices that focus more one available memory ? 
3. Assume that the performance loss caused by swap is tolerable on specific
   embedded devices. Is it more reasonable to use MemAvailable plus the fluctuation
   value of memory valuation due to watermark adjustment as the true available
   memory of these devices?

Thank you for considering my inquiry. I eagerly anticipate the opportunity to connect
with you and gain insights from your wealth of knowledge and experience.

Warm regards,

Jinhao Chen
ZTE Corporation.


                 reply	other threads:[~2024-05-13  1:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240513094904033EDcCrUwr6SiEbZC4kH08i@zte.com.cn \
    --to=long.yunjian@zte.com.cn \
    --cc=chen.jinhao@zte.com.cn \
    --cc=jiang.xuexin@zte.com.cn \
    --cc=jiang.yong5@zte.com.cn \
    --cc=linux-mm@kvack.org \
    --cc=wang.liang82@zte.com.cn \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).