mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
e2c334d6e4
Workers are only summoned by the manager or when there are no workers on a work queue. In case a work in front of a work queue depends on a work behind it, a deadlock may occur. To solve this Linux spawns a rescue worker using timers. Timing of Linux based drivers is currently reworked and not reliable. Therefore, we increase the number of workers that are spawned from 1 to 3 per work queue in order to resolve possible deadlocks. Fixes #4762
21 lines
669 B
Diff
21 lines
669 B
Diff
This patch increases the amount of worker that will be spawned upon a work queue
|
|
when a work is submitted. The patch implies that three workers will be used for
|
|
three works (before it was one). The fourth work will be queued.
|
|
|
|
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
|
|
index ccad28b..ed16e05 100644
|
|
--- a/kernel/workqueue.c
|
|
+++ b/kernel/workqueue.c
|
|
@@ -763,7 +763,10 @@ static bool work_is_canceling(struct work_struct *work)
|
|
|
|
static bool __need_more_worker(struct worker_pool *pool)
|
|
{
|
|
- return !atomic_read(&pool->nr_running);
|
|
+ /*
|
|
+ * Assume two works can deadlock and make a third available
|
|
+ */
|
|
+ return atomic_read(&pool->nr_running) < 3;
|
|
}
|
|
|
|
/*
|