All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@redhat.com>,
	jkenisto@us.ibm.com, davem@davemloft.net, rusty@rustcorp.com.au,
	linux-kernel@vger.kernel.org, systemtap@sources.redhat.com
Subject: Re: [PATCH 4/7] kprobes: Support probing module __exit function
Date: Fri, 14 Nov 2008 10:21:35 +0530	[thread overview]
Message-ID: <20081114045135.GA3141@in.ibm.com> (raw)
In-Reply-To: <20081113162739.5e871fab.akpm@linux-foundation.org>

On Thu, Nov 13, 2008 at 04:27:39PM -0800, Andrew Morton wrote:
> On Tue, 11 Nov 2008 15:56:58 -0500
> Masami Hiramatsu <mhiramat@redhat.com> wrote:
> 
> > @@ -69,9 +69,6 @@ struct kprobe {
> >  	/* list of kprobes for multi-handler support */
> >  	struct list_head list;
> > 
> > -	/* Indicates that the corresponding module has been ref counted */
> > -	unsigned int mod_refcounted;
> > -
> >  	/*count the number of times this probe was temporarily disarmed */
> >  	unsigned long nmissed;
> > 
> > @@ -103,8 +100,19 @@ struct kprobe {
> > 
> >  	/* copy of the original instruction */
> >  	struct arch_specific_insn ainsn;
> > +
> > +	/* Indicates various status flags */
> > +	u32 flags;
> >  };
> > 
> > +/* Kprobe status flags */
> > +#define KPROBE_FLAG_GONE	1 /* breakpoint has already gone */
> > +
> > +static inline int kprobe_gone(struct kprobe *p)
> > +{
> > +	return p->flags & KPROBE_FLAG_GONE;
> > +}
> 
> If we're not going to use atomic bitops on kprobe.flags then
> modifications to that member will require that the caller hold a lock. 
> The comment above that member should describe its locking protocol.  It
> seems that it is kprobe_mutex, so...
> 
> --- a/include/linux/kprobes.h~kprobes-support-probing-module-__exit-function-fix
> +++ a/include/linux/kprobes.h
> @@ -101,7 +101,7 @@ struct kprobe {
>  	/* copy of the original instruction */
>  	struct arch_specific_insn ainsn;
> 
> -	/* Indicates various status flags */
> +	/* Indicates various status flags.  Protected by kprobe_mutex. */
>  	u32 flags;
>  };
> 
> _
> 
> 
> yes?

Right, setting and resetting is done under the kprobe_mutex.

Ananth

      reply	other threads:[~2008-11-14  4:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11 20:56 [PATCH 4/7] kprobes: Support probing module __exit function Masami Hiramatsu
2008-11-12 15:56 ` Ananth N Mavinakayanahalli
2008-11-14  0:27 ` Andrew Morton
2008-11-14  4:51   ` Ananth N Mavinakayanahalli [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=20081114045135.GA3141@in.ibm.com \
    --to=ananth@in.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=systemtap@sources.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 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.