Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f350f02 authored by Vijayanand Jitta's avatar Vijayanand Jitta
Browse files

mm: treat indirectly reclaimable memory as available in MemAvailable



Adjust /proc/meminfo MemAvailable calculation by adding the amount of
indirectly reclaimable memory (rounded to the PAGE_SIZE).

This change is referenced from commit 034ebf65c3c2 ("mm: treat indirectly
reclaimable memory as available in MemAvailable") on upstream, as node
based vmstat global_node_page_state is not present, zone based vmstat
global_page_state is used instead.

Change-Id: I7303d0f8ccd5993c7234a5187430d418d49e5763
Signed-off-by: default avatarVijayanand Jitta <vjitta@codeaurora.org>
parent 7e22f754
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -79,6 +79,13 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
	available += global_page_state(NR_SLAB_RECLAIMABLE) -
		     min(global_page_state(NR_SLAB_RECLAIMABLE) / 2, wmark_low);

	/*
	 * Part of the kernel memory, which can be released under memory
	 * pressure.
	 */
	available += global_page_state(NR_INDIRECTLY_RECLAIMABLE_BYTES) >>
		PAGE_SHIFT;

	if (available < 0)
		available = 0;