All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jason Baron <jbaron@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 5/9] jump label: Add register_jump_label_key/unregister_jump_label_key
Date: Mon, 18 Oct 2010 16:07:51 +0200	[thread overview]
Message-ID: <1287410871.29097.1600.camel@twins> (raw)
In-Reply-To: <20101018140339.GA2814@redhat.com>

On Mon, 2010-10-18 at 10:03 -0400, Jason Baron wrote:
> On Mon, Oct 18, 2010 at 02:05:21PM +0200, Peter Zijlstra wrote:
> > On Fri, 2010-10-15 at 23:13 +0200, Peter Zijlstra wrote:
> > > On Fri, 2010-10-15 at 17:09 -0400, Steven Rostedt wrote:
> > > > On Fri, 2010-10-15 at 23:03 +0200, Peter Zijlstra wrote:
> > > > 
> > > > > Urgh, this sucks.. :-(
> > > > > 
> > > > > So now we have to actually track all JUMP_LABEL() sites and call
> > > > > register muck on them.. even though we already track them through the
> > > > > special data section.
> > > > > 
> > > > > Is there really no way around this?
> > > > 
> > > > I'll take a look to see if we can monkey with magic and automate it.
> > > 
> > > So the problem is something like:
> > > 
> > > core kernel:
> > > 
> > >  jump_label_enable()
> > > 
> > > module:
> > > 
> > >  JUMP_LABEL()
> > > 
> > > And then because we don't have a proper __jump_table section, the
> > > jump_label_enable() won't properly work?
> > > 
> > > Why not let jump_label_enable() add a dummy entry with the enabled bit
> > > and once you load the module merge the real entry into it.
> > 
> > Or actually use the value of the key pointer.. it would mean either
> > standardizing the size (int/atomic_t would work), or using a version of
> > the fallback JUMP_LABEL implementation to sort out the type issues.
> 
> 
> So I initially implmented this as 'jump_label_enable()' would add a new
> entry for the key, if it didn't already exist. However, I was concerned
> about the case where module 'a' defined the key variable, and then
> module 'b' did the enable/disable, and then module 'a' was removed and
> thus the key value could be re-used, and module's 'b' key would mean
> something different.
> 
> However, I'm not sure that is possible - since module 'b' would have
> symbol dependency on module 'a', and thus module 'a' could not be
> unloaded before module 'b'.

Right, if the key variable is part of A and B uses it, then A should not
be allowed to be unloaded.

> Thus, when a module is freed, I think we can scan all the keys and check
> if any key is contained within the text section of the module that is
> about to be freed. If so, we simply remove that key entry. does this
> make sense?

Yep.

  reply	other threads:[~2010-10-18 14:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15 20:09 [PATCH 0/9] [GIT PULL] jump label: various updates Steven Rostedt
2010-10-15 20:09 ` [PATCH 1/9] jump label/x86: Move arch_init_ideal_nop5 later Steven Rostedt
2010-10-15 20:09 ` [PATCH 2/9] tracing/x86: No need to disable interrupts when calling arch_init_ideal_nop5 Steven Rostedt
2010-10-15 20:09 ` [PATCH 3/9] jump label: Fix module __init section race Steven Rostedt
2010-10-16  2:09   ` Steven Rostedt
2010-10-16  6:23     ` Ingo Molnar
2010-10-16 16:23       ` Steven Rostedt
2010-10-18 14:14         ` Jason Baron
2010-10-15 20:09 ` [PATCH 4/9] jump label: Fix deadlock b/w jump_label_mutex vs. text_mutex Steven Rostedt
2010-10-15 20:55   ` Peter Zijlstra
2010-10-16  2:16     ` Steven Rostedt
2010-10-16  2:25     ` Steven Rostedt
2010-10-16  4:21       ` Steven Rostedt
2010-10-15 20:09 ` [PATCH 5/9] jump label: Add register_jump_label_key/unregister_jump_label_key Steven Rostedt
2010-10-15 20:58   ` Peter Zijlstra
2010-10-16  2:11     ` Steven Rostedt
2010-10-15 21:03   ` Peter Zijlstra
2010-10-15 21:09     ` Steven Rostedt
2010-10-15 21:13       ` Peter Zijlstra
2010-10-18 12:05         ` Peter Zijlstra
2010-10-18 14:03           ` Jason Baron
2010-10-18 14:07             ` Peter Zijlstra [this message]
2010-10-15 20:09 ` [PATCH 6/9] jump label: Move jump table to r/w section Steven Rostedt
2010-10-15 20:09 ` [PATCH 7/9] jump label: Add docs Steven Rostedt
2010-10-15 20:09 ` [PATCH 8/9] jump label: Make arch_jump_label_text_poke_early() optional Steven Rostedt
2010-10-15 21:06   ` Peter Zijlstra
2010-10-15 21:08     ` Steven Rostedt
2010-10-15 21:22       ` David Daney
2010-10-15 21:35         ` Steven Rostedt
2010-10-15 21:38           ` David Daney
2010-10-16  1:08             ` Steven Rostedt
2010-10-30 10:40   ` [tip:perf/urgent] " tip-bot for Steven Rostedt
2010-10-15 20:09 ` [PATCH 9/9] jump label: Add MIPS support Steven Rostedt
2010-10-15 20:17 ` [PATCH 0/9] [GIT PULL] jump label: various updates Steven Rostedt
2010-10-16  1:10 ` Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2010-10-04 18:56 [PATCH v2 0/2] jump label: Add MIPS architecture support David Daney
2010-10-04 18:56 ` [PATCH v2 1/2] jump label: Make arch_jump_label_text_poke_early() optional David Daney
2010-10-04 18:56 ` [PATCH v2 2/2] jump label: Add MIPS support David Daney
2010-10-06 23:00   ` Ralf Baechle
2010-10-07  1:26     ` David Daney

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=1287410871.29097.1600.camel@twins \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /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.