lkml.org 
[lkml]   [2020]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] io-wq: set task TASK_INTERRUPTIBLE state before schedule_timeout
Date
From: Zqiang <qiang.zhang@windriver.com>

In 'io_wqe_worker' thread, if the work which in 'wqe->work_list' be
finished, the 'wqe->work_list' is empty, and after that the
'__io_worker_idle' func return false, the task state is TASK_RUNNING,
need to be set TASK_INTERRUPTIBLE before call schedule_timeout func.

Signed-off-by: Zqiang <qiang.zhang@windriver.com>
---
fs/io-wq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io-wq.c b/fs/io-wq.c
index 02894df7656d..5f0626935b64 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -618,7 +618,7 @@ static int io_wqe_worker(void *data)
raw_spin_unlock_irq(&wqe->lock);
if (signal_pending(current))
flush_signals(current);
- if (schedule_timeout(WORKER_IDLE_TIMEOUT))
+ if (schedule_timeout_interruptible(WORKER_IDLE_TIMEOUT))
continue;
/* timed out, exit unless we're the fixed worker */
if (test_bit(IO_WQ_BIT_EXIT, &wq->state) ||
--
2.17.1
\
 
 \ /
  Last update: 2020-10-27 04:10    [W:0.052 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site