From: Petr Bena <petr@bena.rocks>
To: linux-kernel@vger.kernel.org
Subject: Why is Dirty and Writeback part of "MemAvailable" in /proc/meminfo?
Date: Sun, 23 Jun 2024 14:56:53 +0200 [thread overview]
Message-ID: <45d9cf65-7d23-475b-83d0-4bf649553b02@bena.rocks> (raw)
Hello,
Apologies if this is already answered somewhere, but quick google search
returned nothing on-topic:
There is one thing that really puzzles me about /proc/meminfo (and
subsequently about data reported by all other tools, like free, top etc.
that take those numbers from same place) - why is "dirty" and
"writeback" part of "available" memory?
My understanding is that "available" was introduced to confuse less
users by relatively low amount of "free" memory, which is very often
occupied by disk and FS caches as it can be dropped almost any time as
needed, but that's not quite the case with writeback and dirty memory -
both of them have to be written to the disk first, which is not an
instant operation, in fact with slow storage it takes some time during
which memory is unusable, so there is nothing inherently "available"
about that memory.
If you configure your kernel for aggressive caching and run some large
IO writing operations, most of your memory is going to be full by dirty
pages and should some program need to quickly allocate it, it would
fail, yet /proc/meminfo would be reporting plenty of available memory.
Shouldn't this logic be changed? What's the reasoning behind that?
Thanks
reply other threads:[~2024-06-23 13:03 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=45d9cf65-7d23-475b-83d0-4bf649553b02@bena.rocks \
--to=petr@bena.rocks \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®