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

Commit d97c09c1 authored by Vijayanand Jitta's avatar Vijayanand Jitta
Browse files

mm: treat indirectly reclaimable memory as free in overcommit logic



Indirectly reclaimable memory can consume a significant part of total
memory and it's actually reclaimable (it will be released under actual
memory pressure).This patch considers it as free in overcommit logic.

This patch is referenced from commit d79f7aa496fc ("mm: treat indirectly
reclaimable memory as free in overcommit logic") on upstream, as node
based vmstat global_node_page_state is not present zone based vmstat
global_page_state is used instead.

Change-Id: I9af71c566c83e24cd12e7653782b1898ccc7d680
Signed-off-by: default avatarVijayanand Jitta <vjitta@codeaurora.org>
parent 1f350f02
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -205,6 +205,13 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
		 */
		free += global_page_state(NR_SLAB_RECLAIMABLE);

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

		/*
		 * Leave reserved pages. The pages are not for anonymous pages.
		 */
+7 −0
Original line number Diff line number Diff line
@@ -1879,6 +1879,13 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
		 */
		free += global_page_state(NR_SLAB_RECLAIMABLE);

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

		/*
		 * Leave reserved pages. The pages are not for anonymous pages.
		 */