All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Andrey Tsyvarev <tsyvarev@ispras.ru>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] kernel/module.c: Free lock-classes if parse_args failed
Date: Thu, 19 Feb 2015 13:24:01 +0100	[thread overview]
Message-ID: <20150219122401.GA7047@gmail.com> (raw)
In-Reply-To: <20150219115735.GI5029@twins.programming.kicks-ass.net>


* Peter Zijlstra <peterz@infradead.org> 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 <mingo@kernel.org>

Thanks,

	Ingo

      reply	other threads:[~2015-02-19 12:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14  6:25 [PATCH] kernel/module.c: Free lock-classes if parse_args failed Andrey Tsyvarev
2015-01-20  6:37 ` Rusty Russell
2015-01-20  7:47   ` Andrey Tsyvarev
2015-01-21  1:40     ` Rusty Russell
2015-01-21 10:49       ` Andrey Tsyvarev
2015-01-22  0:40         ` Rusty Russell
2015-01-22  9:27           ` Andrey Tsyvarev
2015-01-20  9:48   ` Peter Zijlstra
2015-02-19  0:12     ` Ingo Molnar
2015-02-19 11:57       ` Peter Zijlstra
2015-02-19 12:24         ` Ingo Molnar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150219122401.GA7047@gmail.com \
    --to=mingo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tsyvarev@ispras.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.