From e3dc7d8199f834a65fc06182f97c6035ce251b13 Mon Sep 17 00:00:00 2001 From: LibXZR Date: Tue, 20 Jul 2021 21:54:45 +0800 Subject: [PATCH] ion: Limit max active to 1 for the buffer freeing workers * This is not something time critical. The load of the workqueues can sometimes be very high, especially when unbound workqueues are restricted to small cluster, bringing notable lags to userspace. Limit it with max_active = 1 to reduce the instantaneous load. * This fixes UI lags after running faceunlock on OOS. Signed-off-by: LibXZR --- drivers/staging/android/ion/ion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index eb69c5f9d41b..7f0c372153bd 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -514,7 +514,7 @@ void ion_add_heap(struct ion_device *idev, struct ion_heap *heap) if (heap->flags & ION_HEAP_FLAG_DEFER_FREE) { heap->wq = alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM | - WQ_CPU_INTENSIVE, 0, heap->name); + WQ_CPU_INTENSIVE, 1, heap->name); BUG_ON(!heap->wq); }