MemAvailable的计算方式

MemAvailable是系统对内存可用空间的估算值,计算方式:

MemAvailable
= MemFree - wmark_low
+ pagecache
+ slab_reclaimable
= MemFree - wmark_low
+ Active(file) + Inactive(file) - min((Active(file) + Inactive(file))/2, wmark_low)
+ SReclaimable - min(SReclaimable/2, wmark_low)
= MemFree + Active(file) + Inactive(file) + SReclaimable
- wmark_low
- min((Active(file) + Inactive(file))/2, wmark_low)
- min(SReclaimable/2, wmark_low)

计算的代码:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
详细解析:
https://blog.csdn.net/mrhjlong/article/details/130628208
自整理的内存分类
https://www.sidney.wiki/linuxkernel/774.html

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注

滚动至顶部