From: Andrew Morton <akpm@linux-foundation.org>
To: Masami Hiramatsu <mhiramat@redhat.com>
Cc: ananth@in.ibm.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: Thu, 13 Nov 2008 16:27:39 -0800 [thread overview]
Message-ID: <20081113162739.5e871fab.akpm@linux-foundation.org> (raw)
In-Reply-To: <4919F19A.9050904@redhat.com>
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?
next prev parent reply other threads:[~2008-11-14 0:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-11 20:56 Masami Hiramatsu
2008-11-12 15:56 ` Ananth N Mavinakayanahalli
2008-11-14 0:27 ` Andrew Morton [this message]
2008-11-14 4:51 ` Ananth N Mavinakayanahalli
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=20081113162739.5e871fab.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome