drop the probe lock while scheduling a probe

The great witness test introduced by @bsdphk and reworked relatively
recently by @Dridi reported a hypothetical lock cycle here.

This was not a real issue, because the scheduling code would not re-enter
the probe code, yet we might still drop the probe lock while
scheduling.
parent 11d0f63d
......@@ -465,6 +465,7 @@ vbp_thread(struct worker *wrk, void *priv)
{
vtim_real now, nxt;
struct vbp_target *vt;
int r;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
AZ(priv);
......@@ -486,7 +487,10 @@ vbp_thread(struct worker *wrk, void *priv)
vt->running = 1;
vt->task.func = vbp_task;
vt->task.priv = vt;
if (Pool_Task_Any(&vt->task, TASK_QUEUE_REQ))
Lck_Unlock(&vbp_mtx);
r = Pool_Task_Any(&vt->task, TASK_QUEUE_REQ);
Lck_Lock(&vbp_mtx);
if (r)
vt->running = 0;
}
binheap_insert(vbp_heap, vt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment