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 <charante@codeaurora.org>
[cgoldswo@codeaurora.org: Fix merge conflicts, apply change elsewhere]
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
This commit is contained in:
Charan Teja Reddy 2020-01-24 13:58:11 +05:30 • committed by Chris Goldsworthy
commit 6dccca705b

View file

@ -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;