mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Why is Dirty and Writeback part of "MemAvailable" in /proc/meminfo?
@ 2024-06-23 12:56 Petr Bena
  0 siblings, 0 replies; only message in thread
From: Petr Bena @ 2024-06-23 12:56 UTC (permalink / raw)
  To: linux-kernel

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-23 13:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-23 12:56 Why is Dirty and Writeback part of "MemAvailable" in /proc/meminfo? Petr Bena

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®