mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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). Link: http://lkml.kernel.org/r/20180305133743.12746-4-guro@fb.com Signed-off-by: Roman Gushchin <guro@fb.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Michal Hocko <mhocko@suse.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-Commit: 034ebf65c3c21d85b963d39f992258a64a85e3a9 Git-Repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git Change-Id: I32547afd6ffa8c7979aa1d5978a7b9aef84aff4a Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
This commit is contained in:
parent
fd82bbcb2b
commit
d680316d79
@ -4558,6 +4558,13 @@ long si_mem_available(void)
|
||||
min(global_node_page_state(NR_SLAB_RECLAIMABLE) / 2,
|
||||
wmark_low);
|
||||
|
||||
/*
|
||||
* Part of the kernel memory, which can be released under memory
|
||||
* pressure.
|
||||
*/
|
||||
available += global_node_page_state(NR_INDIRECTLY_RECLAIMABLE_BYTES) >>
|
||||
PAGE_SHIFT;
|
||||
|
||||
if (available < 0)
|
||||
available = 0;
|
||||
return available;
|
||||
|
Loading…
x
Reference in New Issue
Block a user