From 6dccca705bbaf1c6223c3a0ef47070915df02af2 Mon Sep 17 00:00:00 2001 From: Charan Teja Reddy Date: Fri, 24 Jan 2020 13:58:11 +0530 Subject: [PATCH] ion: don't wakeup refill threads for order-0 requests We check the pool->count against the ION_POOL_LOW_MARK before deciding to wakeup the refill threads. But as we never refill the order-0 pool, we will keep waking up these refill threads only they goto sleep again without doing any work. The overhead of waking up of these threads is quite high. Fix it. Change-Id: I0d10b96a46de24b45822ebeda1f20b75e43c2a5d Signed-off-by: Charan Teja Reddy [cgoldswo@codeaurora.org: Fix merge conflicts, apply change elsewhere] Signed-off-by: Chris Goldsworthy --- drivers/staging/android/ion/heaps/ion_system_heap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/ion/heaps/ion_system_heap.c b/drivers/staging/android/ion/heaps/ion_system_heap.c index 6611daa756e6..a4034bb31fb9 100644 --- a/drivers/staging/android/ion/heaps/ion_system_heap.c +++ b/drivers/staging/android/ion/heaps/ion_system_heap.c @@ -99,7 +99,7 @@ static struct page *alloc_buffer_page(struct ion_system_heap *sys_heap, */ *from_pool = false; - if (pool_auto_refill_en && + if (pool_auto_refill_en && pool->order && pool_count_below_lowmark(pool)) { worker = sys_heap->kworker[ION_KTHREAD_UNCACHED]; wake_up_process(worker); @@ -114,10 +114,9 @@ static struct page *alloc_buffer_page(struct ion_system_heap *sys_heap, normal_alloc: page = ion_page_pool_alloc(pool, from_pool); - if (pool_auto_refill_en && - pool_count_below_lowmark(pool) && vmid <= 0) { + if (pool_auto_refill_en && pool->order && + pool_count_below_lowmark(pool) && vmid <= 0) wake_up_process(sys_heap->kworker[cached]); - } if (IS_ERR(page)) return page;