aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2015-02-11 15:01:13 +1030
committerRusty Russell <rusty@rustcorp.com.au>2015-02-11 15:02:04 +1030
commitd64810f56147b53e92228c31442e925576314aa2 (patch)
tree9e9233d0ee22b58edb952cda75dc429d215f79bf /kernel/module.c
parentmodule: Remove double spaces in module verification taint message (diff)
downloadlinux-dev-d64810f56147b53e92228c31442e925576314aa2.tar.xz
linux-dev-d64810f56147b53e92228c31442e925576314aa2.zip
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: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 2461370813b3..d7a92682fba3 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -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);