[dm-devel] [PATCH 1/6] dm: add cond_resched() to dm_wq_work()

Mike Snitzer snitzer at kernel.org
Fri Feb 17 20:07:32 UTC 2023


From: Pingfan Liu <piliu at redhat.com>

Otherwise the while() loop in dm_wq_work() can result in a "dead
loop" on systems that have preemption disabled. This is particularly
problematic on single cpu systems.

Cc: stable at vger.kernel.org
Signed-off-by: Pingfan Liu <piliu at redhat.com>
Acked-by: Ming Lei <ming.lei at redhat.com>
Signed-off-by: Mike Snitzer <snitzer at kernel.org>
---
 drivers/md/dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 90b64bfc63b0..15b91959e433 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2570,6 +2570,7 @@ static void dm_wq_work(struct work_struct *work)
 			break;
 
 		submit_bio_noacct(bio);
+		cond_resched();
 	}
 }
 
-- 
2.37.0 (Apple Git-136)



More information about the dm-devel mailing list