From a48991645891b822244ea05719079b3ce5e6ce29 Mon Sep 17 00:00:00 2001 From: Vijayanand Jitta Date: Tue, 26 May 2020 02:02:58 +0530 Subject: [PATCH] ion: Use kthread_run for ion heap pool kworker threads Ion heap pools are refilled by kworker threads when pool count reaches low mark, these threads are created using kthread_create, as a result these threads will remain in TASK_UNINTERRUPTIBLE state until they are woken up i.e; till low mark is reached. This can result in false hung task reports. So, fix this by replacing kthread_create with kthread_run so that these threads get woken up just after they are created. Change-Id: I3f96387c8a1707e917cbdc2d74b0a64ca6c6cb2f Signed-off-by: Vijayanand Jitta --- drivers/staging/android/ion/heaps/ion_system_heap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/heaps/ion_system_heap.c b/drivers/staging/android/ion/heaps/ion_system_heap.c index 6c9bfc8ff4b5..333608288de6 100644 --- a/drivers/staging/android/ion/heaps/ion_system_heap.c +++ b/drivers/staging/android/ion/heaps/ion_system_heap.c @@ -670,8 +670,8 @@ static struct task_struct *ion_create_kworker(struct ion_page_pool **pools, attr.sched_nice = ION_KTHREAD_NICE_VAL; buf = cached ? "cached" : "uncached"; - thread = kthread_create(ion_sys_heap_worker, pools, - "ion-pool-%s-worker", buf); + thread = kthread_run(ion_sys_heap_worker, pools, + "ion-pool-%s-worker", buf); if (IS_ERR(thread)) { pr_err("%s: failed to create %s worker thread: %ld\n", __func__, buf, PTR_ERR(thread));