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

Commit f2681234 authored by Hareesh Gundu's avatar Hareesh Gundu
Browse files

msm: kgsl: Fix NR_KERNEL_MISC_RECLAIMABLE page stats issue



We do call _kgsl_pool_get_page() when pool is empty through
page pool allocation path. This will cause incorrect page
stats accounting for NR_KERNEL_MISC_RECLAIMABLE. Hence Add
a NULL check before page stats to fix it.

Change-Id: I5823177d7e242db25aeca2da5a9ddf6d1982859b
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent 5b478488
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -120,11 +120,14 @@ _kgsl_pool_get_page(struct kgsl_page_pool *pool)
	struct page *p = NULL;

	spin_lock(&pool->list_lock);
	if (pool->page_count) {
		p = list_first_entry(&pool->page_list, struct page, lru);

	p = list_first_entry_or_null(&pool->page_list, struct page, lru);
	if (p == NULL) {
		spin_unlock(&pool->list_lock);
		return NULL;
	}
	pool->page_count--;
	list_del(&p->lru);
	}
	spin_unlock(&pool->list_lock);
	mod_node_page_state(page_pgdat(p), NR_KERNEL_MISC_RECLAIMABLE,
				-(1 << pool->pool_order));