public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
To: "bibo,mao" <bibo.mao@intel.com>
Cc: prasanna@in.ibm.com, systemtap@sources.redhat.com,
		Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
		"Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com>,
		Jim Keniston <jkenisto@us.ibm.com>,
		Satoshi Oshima <soshima@redhat.com>,
		Yumiko Sugita <sugita@sdl.hitachi.co.jp>,
		Hideo Aoki <haoki@redhat.com>, Maneesh Soni <maneesh@in.ibm.com>
Subject: Re: [PATCH] kprobe-booster: boosting multi-probe
Date: Mon, 13 Mar 2006 13:51:00 -0000	[thread overview]
Message-ID: <441578BF.6090001@sdl.hitachi.co.jp> (raw)
In-Reply-To: <44151136.7020101@intel.com>

Hi, bibo

bibo,mao wrote:
> Hi Marami,
> I refresh kprobe boost patch as follows, in this patch post_handler is
> seperated from break_handler.

The part of the patch against kernel/kprobes.c seems good to me.
But I found a bug.

> @@ -537,6 +539,18 @@ valid_p:
>          }
>          arch_remove_kprobe(p);
>      }
> +    else{
> +        mutex_lock(&kprobe_mutex);
> +        if (p->break_handler)
> +            old_p->break_handler = NULL;
> +        if (p->post_handler){
> +            list_for_each_entry_rcu(list_p, &old_p->list, list){
> +                if (list_p->post_handler) break;
> +                old_p->post_handler = NULL;
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
When the head of the list does not have a post_handler, this code
always clear the aggr_kprobe's post_handler.

> +            }
> +        }
> +        mutex_unlock(&kprobe_mutex);
> +    }
>  }


And the next part is not comfortable to me.

> And I think booster can be enabled even
> when preempt is disabled.

I think your patch enables booster even when preemption is
enabled, and it may be dangerous. Some running processes can
be preempted by another process when it is executing the codes in
the instruction buffer. When the boosted-probe is deregistered, that
instruction buffer is removed. Then, those preempted processes
can't continue to run, because they can't back to the preempted address.
So, I think, for the safety, the booster should NOT be enabled when
preemption is enabled.
Please fix it.


-- 
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: hiramatu@sdl.hitachi.co.jp

  reply	other threads:[~2006-03-13 13:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-17  9:06 Masami Hiramatsu
2006-02-17  9:51 ` Prasanna S Panchamukhi
2006-02-17 12:31   ` Masami Hiramatsu
2006-03-13  6:39     ` bibo,mao
2006-03-13 13:51       ` Masami Hiramatsu [this message]
2006-03-14  2:16         ` bibo,mao
2006-03-15 13:38           ` Masami Hiramatsu
2006-04-26  7:51           ` Masami Hiramatsu
2006-04-26  9:33             ` bibo,mao

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=441578BF.6090001@sdl.hitachi.co.jp \
    --to=hiramatu@sdl.hitachi.co.jp \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=bibo.mao@intel.com \
    --cc=haoki@redhat.com \
    --cc=jkenisto@us.ibm.com \
    --cc=maneesh@in.ibm.com \
    --cc=prasanna@in.ibm.com \
    --cc=soshima@redhat.com \
    --cc=sugita@sdl.hitachi.co.jp \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).