Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f796906 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "workqueue: fix possible livelock with concurrent mod_delayed_work()"

parents caa1907e d1f21a7e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#include <linux/moduleparam.h>
#include <linux/uaccess.h>
#include <linux/bug.h>
#include <linux/delay.h>

#include "workqueue_internal.h"

@@ -1285,6 +1286,12 @@ fail:
	if (work_is_canceling(work))
		return -ENOENT;
	cpu_relax();
	/*
	 * The queueing is in progress in another context. If we keep
	 * taking the pool->lock in a busy loop, the other context may
	 * never get the lock. Give 1 usec delay to avoid this contention.
	 */
	udelay(1);
	return -EAGAIN;
}