Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753199AbbBJRGP (ORCPT ); Tue, 10 Feb 2015 12:06:15 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:52048 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752198AbbBJRGM (ORCPT ); Tue, 10 Feb 2015 12:06:12 -0500 Date: Tue, 10 Feb 2015 18:06:04 +0100 From: Peter Zijlstra To: Dave Jones , Linux Kernel Cc: Rusty Russell Subject: [PATCH] module: Annotate nested sleep in resolve_symbol() Message-ID: <20150210170604.GA21418@twins.programming.kicks-ass.net> References: <20150210164217.GA5547@codemonkey.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150210164217.GA5547@codemonkey.org.uk> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1218 Lines: 33 Because wait_event() loops are safe vs spurious wakeups we can allow the occasional sleep -- which ends up being very similar. Cc: Rusty Russell Reported-by: Dave Jones Signed-off-by: Peter Zijlstra (Intel) --- kernel/module.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/module.c b/kernel/module.c index d856e96a3cce..11d3bc18157e 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/