diff options
| author | Vijayanand Jitta <vjitta@codeaurora.org> | 2018-04-10 16:27:40 -0700 |
|---|---|---|
| committer | Vijayanand Jitta <vjitta@codeaurora.org> | 2018-05-08 10:56:53 +0530 |
| commit | 1f350f02fcb9075c8dfbd8f3d329244ebd0fbcd6 (patch) | |
| tree | 1b1958d3305e06c4496efb5ecbd5773723fe4781 | |
| parent | 7e22f75445517436fd3e937ef865909408cc625c (diff) | |
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: Vijayanand Jitta <vjitta@codeaurora.org>
| -rw-r--r-- | fs/proc/meminfo.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c index 9155a5a0d3b9..b7594b9fa5fa 100644 --- a/fs/proc/meminfo.c +++ b/fs/proc/meminfo.c @@ -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; |
