Messages in this thread Patch in this message |  | | From | Shaohua Li <> | Subject | [PATCH] kthread_worker: don't hog the cpu | Date | Fri, 25 Aug 2017 14:44:50 -0700 |
| |
If the worker thread continues getting work, it will hog the cpu and rcu stall complains. Make it a good citizen. This is triggered in a loop block device test.
Signed-off-by: Shaohua Li <shli@fb.com> --- kernel/kthread.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/kernel/kthread.c b/kernel/kthread.c index 26db528..1c19edf 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -637,6 +637,7 @@ int kthread_worker_fn(void *worker_ptr) schedule(); try_to_freeze(); + cond_resched(); goto repeat; } EXPORT_SYMBOL_GPL(kthread_worker_fn); -- 2.9.5
|  |