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

Commit ff60d1d2 authored by Vijayanand Jitta's avatar Vijayanand Jitta Committed by Prakash Gupta
Browse files

ion: add ion pages to NR_UNRECLAIMABLE_PAGES



add the ion pages allocated through system and system secure
heaps to NR_UNRECLAIMABLE_PAGES memory counter.

Change-Id: I4bf846fcd0454a5ba0e1cad08e9b7e882f92ceac
Signed-off-by: default avatarVijayanand Jitta <vjitta@codeaurora.org>
[guptap@codeaurora.org: Add Kconfig entry to prevent ABI breakages in GKI]
Signed-off-by: default avatarPrakash Gupta <guptap@codeaurora.org>
parent bfe3637f
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -153,8 +153,19 @@ void free_buffer_page(struct ion_system_heap *heap,
			ion_page_pool_free_immediate(pool, page);
		else
			ion_page_pool_free(pool, page);

#ifdef CONFIG_MM_STAT_UNRECLAIMABLE_PAGES
		mod_node_page_state(page_pgdat(page), NR_UNRECLAIMABLE_PAGES,
				    -(1 << pool->order));
#endif
	} else {
		__free_pages(page, order);

#ifdef CONFIG_MM_STAT_UNRECLAIMABLE_PAGES
		mod_node_page_state(page_pgdat(page), NR_UNRECLAIMABLE_PAGES,
				    -(1 << order));
#endif

	}
}

@@ -314,6 +325,12 @@ static int ion_system_heap_allocate(struct ion_heap *heap,

		sz = (1 << info->order) * PAGE_SIZE;

#ifdef CONFIG_MM_STAT_UNRECLAIMABLE_PAGES
		mod_node_page_state(page_pgdat(info->page),
				    NR_UNRECLAIMABLE_PAGES,
				    (1 << (info->order)));
#endif

		if (info->from_pool) {
			list_add_tail(&info->list, &pages_from_pool);
		} else {