From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753365AbbBSMYI (ORCPT ); Thu, 19 Feb 2015 07:24:08 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:53187 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753287AbbBSMYG (ORCPT ); Thu, 19 Feb 2015 07:24:06 -0500 Date: Thu, 19 Feb 2015 13:24:01 +0100 From: Ingo Molnar To: Peter Zijlstra Cc: Rusty Russell , Andrey Tsyvarev , linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH] kernel/module.c: Free lock-classes if parse_args failed Message-ID: <20150219122401.GA7047@gmail.com> References: <1421216708-1975-1-git-send-email-tsyvarev@ispras.ru> <87iog2arfk.fsf@rustcorp.com.au> <20150120094805.GB11596@twins.programming.kicks-ass.net> <20150219001233.GC10076@gmail.com> <20150219115735.GI5029@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150219115735.GI5029@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra wrote: > > indeed ... > > How about something like so? It would fix this particular > issue and lays the groundwork for maybe reusing some of > the resources we now leak. > @@ -3916,6 +3926,20 @@ void lockdep_free_key_range(void *start, unsigned long size) > if (locked) > graph_unlock(); > raw_local_irq_restore(flags); > + > + /* > + * Wait for any possible iterators from look_up_lock_class() to pass > + * before continuing to free the memory they refer to. > + * > + * sync_sched() is sufficient because the read-side is IRQ disable. > + */ > + synchronize_sched(); > + /* Free lock-classes; relies on the preceding sync_rcu(). */ > lockdep_free_key_range(mod->module_core, mod->core_size); > free_module: > + /* Free lock-classes; relies on the preceding sync_rcu() */ > + lockdep_free_key_range(mod->module_core, mod->core_size); Yeah. Looks good to me in principle, without having tested it that is as I don't use modules on devel boxes: Reviewed-by: Ingo Molnar Thanks, Ingo