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

Commit d64810f5 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Rusty Russell
Browse files

module: Annotate nested sleep in resolve_symbol()



Because wait_event() loops are safe vs spurious wakeups we can allow the
occasional sleep -- which ends up being very similar.

Reported-by: default avatarDave Jones <davej@codemonkey.org.uk>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarDave Jones <davej@codemonkey.org.uk>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent ab92ebbb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1225,6 +1225,12 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod,
	const unsigned long *crc;
	int err;

	/*
	 * The module_mutex should not be a heavily contended lock;
	 * if we get the occasional sleep here, we'll go an extra iteration
	 * in the wait_event_interruptible(), which is harmless.
	 */
	sched_annotate_sleep();
	mutex_lock(&module_mutex);
	sym = find_symbol(name, &owner, &crc,
			  !(mod->taints & (1 << TAINT_PROPRIETARY_MODULE)), true);