public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com>,
		Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
		Prasanna S Panchamukhi <prasanna@in.ibm.com>,
		Ingo Molnar <mingo@redhat.com>,
		SystemTAP <systemtap@sources.redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
		Satoshi Oshima <soshima@redhat.com>,
	Hideo Aoki <haoki@redhat.com>,
		Yumiko Sugita <yumiko.sugita.yf@hitachi.com>
Subject: [PATCH 5/5][djprobe] delayed invoking commit_djprobes()
Date: Thu, 19 Oct 2006 09:04:00 -0000	[thread overview]
Message-ID: <45373F5E.8000906@hitachi.com> (raw)
In-Reply-To: <45338593.6090207@hitachi.com>

Hi,

This patch invokes commit_djprobes() function from a worker.
This worker is scheduled automatically by register/
unregister_djprobe() functions and is executed in 0.1 second.
If the worker fails freezing processes, it will try again
after 0.1 second.

Thanks,
-- 
Masami HIRAMATSU
Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com

---
 kernel/djprobe.c |   23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

Index: linux-2.6.19-rc1-mm1/kernel/djprobe.c
===================================================================
--- linux-2.6.19-rc1-mm1.orig/kernel/djprobe.c	2006-10-16 22:06:22.000000000 +0900
+++ linux-2.6.19-rc1-mm1/kernel/djprobe.c	2006-10-16 22:06:44.000000000 +0900
@@ -64,6 +64,15 @@
 static LIST_HEAD(registering_list);
 static LIST_HEAD(unregistering_list);

+static void commit_work_fn(void * data);
+static DECLARE_WORK(commit_work, commit_work_fn, 0);
+#define DJPROBE_COMMIT_DELAY (HZ/10)
+
+static __always_inline void kick_delayed_commit(void)
+{
+	schedule_delayed_work(&commit_work, DJPROBE_COMMIT_DELAY);
+}
+
 static int __djprobe_pre_handler(struct kprobe *kp, struct pt_regs *regs)
 {
 	struct djprobe_instance *djpi =
@@ -211,12 +220,18 @@

 int __kprobes commit_djprobes(void)
 {
-	int ret;
+	int ret = 0;
 	BUG_ON(in_interrupt());
+	commit_work_fn(NULL);
+	return ret;
+}
+
+static void commit_work_fn(void * data)
+{
 	mutex_lock(&djprobe_mutex);
-	ret = __commit_djprobes();
+	if (__commit_djprobes() < 0)
+		kick_delayed_commit();/* try again */
 	mutex_unlock(&djprobe_mutex);
-	return ret;
 }

 int __kprobes register_djprobe(struct djprobe *djp)
@@ -265,6 +280,7 @@
 	djp->inst = djpi;
 	INIT_LIST_HEAD(&djp->plist);
 	list_add_rcu(&djp->plist, &djpi->plist);
+	kick_delayed_commit();

       out:
 	mutex_unlock(&djprobe_mutex);
@@ -286,6 +302,7 @@
 			list_del_init(&djpi->rlist);
 		arch_pre_remove_djprobe_instance(djpi);
 		list_add(&djpi->rlist, &unregistering_list);
+		kick_delayed_commit();
 	}
 	mutex_unlock(&djprobe_mutex);
 }






  parent reply	other threads:[~2006-10-19  9:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-16 13:14 [RFC][PATCH][kprobe] enabling booster on the preemptible kernel, take 2 Masami Hiramatsu
2006-10-19  9:00 ` [PATCH 1/5][djprobe] generalize the length of the instruction slots Masami Hiramatsu
2006-10-19  9:03 ` [PATCH 2/5][djprobe] djprobe core patch Masami Hiramatsu
2006-10-27 23:34   ` Keshavamurthy, Anil S
2006-10-30 14:07     ` Masami Hiramatsu
2006-10-30 14:11       ` Ingo Molnar
2006-10-19  9:03 ` [PATCH 4/5][djprobe] djprobe for i386 architecture code Masami Hiramatsu
2006-10-19  9:03 ` [PATCH 3/5][djprobe] export set_jmp_op() for sharing Masami Hiramatsu
2006-10-19  9:04 ` Masami Hiramatsu [this message]
2006-10-19  9:04 ` [RFC][djprobe] djprobe examples Masami Hiramatsu
2006-10-30  6:37 ` [RFC][PATCH][kprobe] enabling booster on the preemptible kernel, take 2 bibo,mao
2006-10-30 14:07   ` Masami Hiramatsu
2006-10-31  9:14     ` bibo,mao
2006-10-31 13:47       ` Masami Hiramatsu
2006-10-31 13:49         ` Ingo Molnar
2006-10-31 14:13         ` Ingo Molnar
2006-10-31 16:39           ` Masami Hiramatsu

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=45373F5E.8000906@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=haoki@redhat.com \
    --cc=mingo@redhat.com \
    --cc=prasanna@in.ibm.com \
    --cc=soshima@redhat.com \
    --cc=systemtap@sources.redhat.com \
    --cc=yumiko.sugita.yf@hitachi.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).