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>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
		SystemTAP <systemtap@sources.redhat.com>,
		Yumiko Sugita <yumiko.sugita.yf@hitachi.com>,
		Satoshi Oshima <soshima@redhat.com>,
	Hideo Aoki <haoki@redhat.com>,
		Prasanna S Panchamukhi <prasanna@in.ibm.com>,
		Jim Keniston <jkenisto@us.ibm.com>
Subject: Preemption-safe kprobe-booster(Re: [PATCH]kprobe booster for IA64)
Date: Wed, 12 Jul 2006 06:22:00 -0000	[thread overview]
Message-ID: <44B4952D.9010603@hitachi.com> (raw)
In-Reply-To: <44AAF207.7090908@sdl.hitachi.co.jp>

Hi, Anil

Masami Hiramatsu wrote:
> Hi, Anil
> 
> Keshavamurthy Anil S wrote:
>> pre_preempt_count will always be one here, since 
>> notify_die()->atomic_notifier_call_chain()->read_rcu_lock()->preeempt_disable(). 
>> So currently you might be preparing for boosting even for 
>> preemptable code path. Can you verify this.
> 
> Thank you for the advice!
> I hadn't realized it. Now, I verified it and had some ideas.
> The problem comes from reusing the insn buffer, because
> there might be some processes sleeping on the buffer.
> So, I think we can avoid this problem as below:
> First, we disable a kprobe (remove the break). Next,
> wait until all preempted processes are waken up. And Last,
> we release its insn buffer to reuse. Then, it will be safe.
> Because there is no process slept on the buffer.
> 
> For this purpose, I'd like to use stop_machine_run().

I and Oshima-san found that stop_machine_run() was not enough
to ensure safety. Instead of that, we focused on synchronize_sched().
As far as we know, this function waits until all processes
are expired. And any preempted processes can't be expired, only
the processes who are scheduled by itself are expired.
This means these processes already left from kprobe's slots.
So, after that, we can release/reuse these slots safely.

> However we can't execute it each releasing time because
> it is very costly.

synchronize_sched() is also costly.

> I think we can resolve it by using garbage collector.
> 
> I describe my idea below:
> The kprobe frees its insn slot(buffer) after disable it.
> Thus, when an insn slot is freed, it will be just marked as
> a garbage. And when get_insn_slot() can't find any free slot,
> it will call the garbage collector to try to refill free slots.

And the garbage collector uses synchronize_sched() to ensure safety.

> What do you think about this idea?
> 
> Best regards,
> 

Thanks,

-- 
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



  reply	other threads:[~2006-07-12  6:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-06  6:35 [PATCH]kprobe booster for IA64 Masami Hiramatsu
2006-06-07  8:17 ` bibo,mao
2006-06-08 14:31   ` Masami Hiramatsu
2006-06-09  3:03     ` bibo,mao
2006-06-15  5:46       ` Masami Hiramatsu
2006-06-27  0:16         ` Masami Hiramatsu
2006-06-29  3:16 ` Keshavamurthy Anil S
2006-07-04 22:56   ` Masami Hiramatsu
2006-07-12  6:22     ` Masami Hiramatsu [this message]
2006-07-12  8:09       ` Preemption-safe kprobe-booster(Re: [PATCH]kprobe booster for IA64) Keshavamurthy Anil S
2006-07-13 11:25         ` Masami Hiramatsu
2006-07-14 18:41           ` Keshavamurthy Anil S
2006-07-15  6:20             ` 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=44B4952D.9010603@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=haoki@redhat.com \
    --cc=jkenisto@us.ibm.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).