VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Pavel Begunkov <asml.silence@gmail.com> 2020-03-14 00:31:03 +0300 committer: Jens Axboe <axboe@kernel.dk> 2020-03-14 17:02:26 -0600 commit: d78298e73a3443a3c1766fa89f5370f52a4efd94 parent: 2293b4195800f88de2c454a24b25874be56d87f3
Commit Summary:
io-wq: don't resched if there is no work
Diffstat:
1 file changed, 6 insertions, 4 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c
index 0e7c6277afcb..8afe5565f57a 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -458,10 +458,12 @@ static void io_impersonate_work(struct io_worker *worker,
 static void io_assign_current_work(struct io_worker *worker,
 				   struct io_wq_work *work)
 {
-	/* flush pending signals before assigning new work */
-	if (signal_pending(current))
-		flush_signals(current);
-	cond_resched();
+	if (work) {
+		/* flush pending signals before assigning new work */
+		if (signal_pending(current))
+			flush_signals(current);
+		cond_resched();
+	}
 
 	spin_lock_irq(&worker->lock);
 	worker->cur_work = work;