Because wait_event() loops are safe vs spurious wakeups we can allow the occasional sleep -- which ends up being very similar.
Showing the changes to kernel/module.c (1 of 1 file). Show all
Unified · Split
| @@ -1225,6 +1225,12 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod, · 1224 unmodified lines | |||
| 1225 | const unsigned long *crc; | 1225 | const unsigned long *crc; |
| 1226 | int err; | 1226 | int err; |
| 1227 | 1227 | ||
| 1228 | /* | ||
| 1229 | * The module_mutex should not be a heavily contended lock; | ||
| 1230 | * if we get the occasional sleep here, we'll go an extra iteration | ||
| 1231 | * in the wait_event_interruptible(), which is harmless. | ||
| 1232 | */ | ||
| 1233 | sched_annotate_sleep(); | ||
| 1228 | mutex_lock(&module_mutex); | 1234 | mutex_lock(&module_mutex); |
| 1229 | sym = find_symbol(name, &owner, &crc, | 1235 | sym = find_symbol(name, &owner, &crc, |
| 1230 | !(mod->taints & (1 << TAINT_PROPRIETARY_MODULE)), true); | 1236 | !(mod->taints & (1 << TAINT_PROPRIETARY_MODULE)), true); |