public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>,
	jbaron@redhat.com, rostedt@goodmis.org,
	linux-kernel@vger.kernel.org, mingo@elte.hu, hpa@zytor.com,
	tglx@linutronix.de, roland@redhat.com, rth@redhat.com,
	mhiramat@redhat.com, avi@redhat.com, davem@davemloft.net,
	vgoyal@redhat.com, sam@ravnborg.org, tony@bakeyournoodle.com,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/2] Add for_each_module iterator function v2
Date: Wed, 22 Sep 2010 16:50:13 +0200	[thread overview]
Message-ID: <20100922145010.GB5302@nowhere> (raw)
In-Reply-To: <20100922143515.GF5766@basil.fritz.box>

On Wed, Sep 22, 2010 at 04:35:15PM +0200, Andi Kleen wrote:
> On Wed, Sep 22, 2010 at 10:14:32AM -0400, Mathieu Desnoyers wrote:
> > * Andi Kleen (andi@firstfloor.org) wrote:
> > > From: Andi Kleen <ak@linux.intel.com>
> > > 
> > > This is a generic function to iterate over all modules.
> > > To be used in the next patch.
> > > 
> > > v2: Use module_mutex instead of preempt disabling
> > > 
> > > Signed-off-by: Andi Kleen <ak@linux.intel.com>
> > > ---
> > >  include/linux/module.h |    1 +
> > >  kernel/module.c        |   10 ++++++++++
> > >  2 files changed, 11 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/include/linux/module.h b/include/linux/module.h
> > > index 403ac26..809b6db 100644
> > > --- a/include/linux/module.h
> > > +++ b/include/linux/module.h
> > > @@ -410,6 +410,7 @@ struct module *__module_address(unsigned long addr);
> > >  bool is_module_address(unsigned long addr);
> > >  bool is_module_percpu_address(unsigned long addr);
> > >  bool is_module_text_address(unsigned long addr);
> > > +void for_each_module(void (*op)(struct module *, void *arg), void *arg);
> > >  
> > >  static inline int within_module_core(unsigned long addr, struct module *mod)
> > >  {
> > > diff --git a/kernel/module.c b/kernel/module.c
> > > index eba1341..9e2a561 100644
> > > --- a/kernel/module.c
> > > +++ b/kernel/module.c
> > > @@ -384,6 +384,16 @@ struct module *find_module(const char *name)
> > >  }
> > >  EXPORT_SYMBOL_GPL(find_module);
> > >  
> > > +void for_each_module(void (*op)(struct module *, void *arg), void *arg)
> > > +{
> > > +	struct module *mod;
> > > +
> > > +	mutex_lock(&module_mutex);
> > 
> > I'm concerned about the following mutex dependency chain:
> > 
> > module_mutex -> jump_label_mutex (on module load)
> > jump_label_mutex -> module_mutex (on jump_label_update)
> 
> There are actually more problems in this version with using
> module_mutex().  Looking at a fix.
> 
> > 
> > Actually, I think your module notifier is missing in your version. This
> > is why you don't see this dependency problem.
> 
> The module notifier is not needed anymore, but there's another 
> callback through the trace point code on module load.
> 
> Unload notifier is not needed anymore because there is no
> state to tear down.
> 
> -Andi


If possible, could you please also join a git url with your next version,
it becomes hard to review as it's delta on top of others patches.

Thanks.


      reply	other threads:[~2010-09-22 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-22 13:26 [PATCH 1/2] Add for_each_module iterator function v2 Andi Kleen
2010-09-22 13:26 ` [PATCH 2/2] Rewrite jump_label.c to use binary search v2 Andi Kleen
2010-09-22 14:14 ` [PATCH 1/2] Add for_each_module iterator function v2 Mathieu Desnoyers
2010-09-22 14:29   ` Jason Baron
2010-09-22 14:35   ` Andi Kleen
2010-09-22 14:50     ` Frederic Weisbecker [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=20100922145010.GB5302@nowhere \
    --to=fweisbec@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=avi@redhat.com \
    --cc=davem@davemloft.net \
    --cc=hpa@zytor.com \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rth@redhat.com \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    --cc=tony@bakeyournoodle.com \
    --cc=vgoyal@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox