This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][kprobes]Preempt enable kprobe-booster(Re: djprobes status)


On Mon, Sep 25, 2006 at 06:03:06AM -0700, Masami Hiramatsu wrote:
Masami,
	Overall the code looks good and I just have a very 
minor comments.

> 
>    Currently, this GC is invoked if 1) there are more than
>    INSNS_PER_PAGE garbage slots or 2) there are no unused slots.
>    Would you have any better idea about these timings? I'd like to
>    receive feedbacks.
Invoking GC looks good to me.


>    -void __kprobes free_insn_slot(kprobe_opcode_t *slot)
>    +static void collect_garbage_slots(void)
>     {
>            struct kprobe_insn_page *kip;
>            struct hlist_node *pos;
>    +#if defined(CONFIG_PREEMPT) && defined(CONFIG_PM)
>    +       /* Ensure no-one is preepmted on the garbages */
>    +       freeze_processes();
I think you need to check for freeze_processes() return value.
If the return value indicates failure, then you must NOT
continue collecting garbage slots, instead call 
thaw_processes() and return.
>    +#endif

[.....]

>    Index: linux-2.6.18/arch/i386/kernel/kprobes.c
>    ===================================================================
>    ---   linux-2.6.18.orig/arch/i386/kernel/kprobes.c          2006-09-25
>    21:44:22.000000000 +0900
>    +++       linux-2.6.18/arch/i386/kernel/kprobes.c           2006-09-25
>    21:44:35.000000000 +0900
>    @@ -333,7 +333,7 @@
>                    return 1;
>     ss_probe:
>    -#ifndef CONFIG_PREEMPT
>    +#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM)

Now you are supporting booster probes independent of CONFIG_PREEMPT (i.e
you are supporting booster probes for CONFIG_PREEMPT defined and for NOT defined cases),
so just defined(CONFIG_PM) should be fine I think.

>            if (p->ainsn.boostable == 1 && !p->post_handler){
>                      /*  Boost  up  -- we can execute copied instructions
>    directly */
>                    reset_current_kprobe();


thanks,
Anil Keshavamurthy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]