13 Sep, 2011

1 commit


08 Jan, 2011

1 commit

  • * 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (30 commits)
    gameport: use this_cpu_read instead of lookup
    x86: udelay: Use this_cpu_read to avoid address calculation
    x86: Use this_cpu_inc_return for nmi counter
    x86: Replace uses of current_cpu_data with this_cpu ops
    x86: Use this_cpu_ops to optimize code
    vmstat: User per cpu atomics to avoid interrupt disable / enable
    irq_work: Use per cpu atomics instead of regular atomics
    cpuops: Use cmpxchg for xchg to avoid lock semantics
    x86: this_cpu_cmpxchg and this_cpu_xchg operations
    percpu: Generic this_cpu_cmpxchg() and this_cpu_xchg support
    percpu,x86: relocate this_cpu_add_return() and friends
    connector: Use this_cpu operations
    xen: Use this_cpu_inc_return
    taskstats: Use this_cpu_ops
    random: Use this_cpu_inc_return
    fs: Use this_cpu_inc_return in buffer.c
    highmem: Use this_cpu_xx_return() operations
    vmstat: Use this_cpu_inc_return for vm statistics
    x86: Support for this_cpu_add, sub, dec, inc_return
    percpu: Generic support for this_cpu_add, sub, dec, inc_return
    ...

    Fixed up conflicts: in arch/x86/kernel/{apic/nmi.c, apic/x2apic_uv_x.c, process.c}
    as per Tejun.

    Linus Torvalds
     

17 Dec, 2010

1 commit


07 Dec, 2010

2 commits

  • Use text_poke_smp_batch() on unoptimization path for reducing
    the number of stop_machine() issues. If the number of
    unoptimizing probes is more than MAX_OPTIMIZE_PROBES(=256),
    kprobes unoptimizes first MAX_OPTIMIZE_PROBES probes and kicks
    optimizer for remaining probes.

    Signed-off-by: Masami Hiramatsu
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Use text_poke_smp_batch() in optimization path for reducing
    the number of stop_machine() issues. If the number of optimizing
    probes is more than MAX_OPTIMIZE_PROBES(=256), kprobes optimizes
    first MAX_OPTIMIZE_PROBES probes and kicks optimizer for
    remaining probes.

    Changes in v5:
    - Use kick_kprobe_optimizer() instead of directly calling
    schedule_delayed_work().
    - Rescheduling optimizer outside of kprobe mutex lock.

    Changes in v2:
    - Allocate code buffer and parameters in arch_init_kprobes()
    instead of using static arraies.
    - Merge previous max optimization limit patch into this patch.
    So, this patch introduces upper limit of optimization at
    once.

    Signed-off-by: Masami Hiramatsu
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: 2nddept-manager@sdl.hitachi.co.jp
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

26 Feb, 2010

2 commits

  • Add /proc/sys/debug/kprobes-optimization sysctl which enables
    and disables kprobes jump optimization on the fly for debugging.

    Changes in v7:
    - Remove ctl_name = CTL_UNNUMBERED for upstream compatibility.

    Changes in v6:
    - Update comments and coding style.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Ananth N Mavinakayanahalli
    Cc: Jim Keniston
    Cc: Srikar Dronamraju
    Cc: Christoph Hellwig
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Anders Kaseorg
    Cc: Tim Abbott
    Cc: Andi Kleen
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Introduce kprobes jump optimization arch-independent parts.
    Kprobes uses breakpoint instruction for interrupting execution
    flow, on some architectures, it can be replaced by a jump
    instruction and interruption emulation code. This gains kprobs'
    performance drastically.

    To enable this feature, set CONFIG_OPTPROBES=y (default y if the
    arch supports OPTPROBE).

    Changes in v9:
    - Fix a bug to optimize probe when enabling.
    - Check nearby probes can be optimize/unoptimize when disarming/arming
    kprobes, instead of registering/unregistering. This will help
    kprobe-tracer because most of probes on it are usually disabled.

    Changes in v6:
    - Cleanup coding style for readability.
    - Add comments around get/put_online_cpus().

    Changes in v5:
    - Use get_online_cpus()/put_online_cpus() for avoiding text_mutex
    deadlock.

    Signed-off-by: Masami Hiramatsu
    Cc: systemtap
    Cc: DLE
    Cc: Ananth N Mavinakayanahalli
    Cc: Jim Keniston
    Cc: Srikar Dronamraju
    Cc: Christoph Hellwig
    Cc: Steven Rostedt
    Cc: Frederic Weisbecker
    Cc: Anders Kaseorg
    Cc: Tim Abbott
    Cc: Andi Kleen
    Cc: Jason Baron
    Cc: Mathieu Desnoyers
    Cc: Frederic Weisbecker
    Cc: Ananth N Mavinakayanahalli
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     

24 Sep, 2009

1 commit


16 Sep, 2009

1 commit

  • When ftrace had issues with NMIs, it was needed to annotate all
    the areas that kprobes had issues with notrace. Now that ftrace is
    NMI safe, the functions that limit ftrace from tracing are just a
    small few.

    Kprobes is too big of a set for ftrace not to trace. Remove the
    coupling.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

27 Aug, 2009

1 commit

  • Kprobes can enter into a probing recursion, ie: a kprobe that does an
    endless loop because one of its core mechanism function used during
    probing is also probed itself.

    This patch helps pinpointing the kprobe that raised such recursion
    by dumping it and raising a BUG instead of a warning (we also disarm
    the kprobe to try avoiding recursion in BUG itself). Having a BUG
    instead of a warning stops the stacktrace in the right place and
    doesn't pollute the logs with hundreds of traces that eventually end
    up in a stack overflow.

    Signed-off-by: Frederic Weisbecker
    Cc: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli

    Frederic Weisbecker
     

07 Apr, 2009

3 commits

  • Add disable/enable_kretprobe() and disable/enable_jprobe().

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Add disable_kprobe() and enable_kprobe() to disable/enable kprobes
    temporarily.

    disable_kprobe() asynchronously disables probe handlers of specified
    kprobe. So, after calling it, some handlers can be called at a while.
    enable_kprobe() enables specified kprobe.

    aggr_pre_handler and aggr_post_handler check disabled probes. On the
    other hand aggr_break_handler and aggr_fault_handler don't check it
    because these handlers will be called while executing pre or post handlers
    and usually those help error handling.

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Fix comment style in kprobes.h.

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     

21 Feb, 2009

1 commit

  • Impact: cleanup

    Remove an #ifdef from notify_page_fault(). The function still
    compiles to nothing in the !CONFIG_KPROBES case.

    Introduce kprobes_built_in() and kprobe_fault_handler() helpers
    to allow this - they returns 0 if !CONFIG_KPROBES.

    No code changed:

    text data bss dec hex filename
    4618 32 24 4674 1242 fault.o.before
    4618 32 24 4674 1242 fault.o.after

    Cc: Masami Hiramatsu
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

30 Jan, 2009

1 commit

  • Define kprobes related data structures even if CONFIG_KPROBES is not set.
    This fixes compilation errors which occur if CONFIG_KPROBES is not set, in
    kprobe using modules.

    [akpm@linux-foundation.org: fix build for non-kprobes-supporting architectures]
    Reviewed-by: Ananth N Mavinakayanahalli
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     

07 Jan, 2009

2 commits

  • Allows kprobes to probe __exit routine. This adds flags member to struct
    kprobe. When module is freed(kprobes hooks module_notifier to get this
    event), kprobes which probe the functions in that module are set to "Gone"
    flag to the flags member. These "Gone" probes are never be enabled.
    Users can check the GONE flag through debugfs.

    This also removes mod_refcounted, because we couldn't free a module if
    kprobe incremented the refcount of that module.

    [akpm@linux-foundation.org: document some locking]
    [mhiramat@redhat.com: bugfix: pass aggr_kprobe to arch_remove_kprobe]
    [mhiramat@redhat.com: bugfix: release old_p's insn_slot before error return]
    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Add kprobe_insn_mutex for protecting kprobe_insn_pages hlist, and remove
    kprobe_mutex from architecture dependent code.

    This allows us to call arch_remove_kprobe() (and free_insn_slot) while
    holding kprobe_mutex.

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: Russell King
    Cc: "Luck, Tony"
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     

14 Oct, 2008

1 commit


26 Jul, 2008

1 commit

  • Currently list of kretprobe instances are stored in kretprobe object (as
    used_instances,free_instances) and in kretprobe hash table. We have one
    global kretprobe lock to serialise the access to these lists. This causes
    only one kretprobe handler to execute at a time. Hence affects system
    performance, particularly on SMP systems and when return probe is set on
    lot of functions (like on all systemcalls).

    Solution proposed here gives fine-grain locks that performs better on SMP
    system compared to present kretprobe implementation.

    Solution:

    1) Instead of having one global lock to protect kretprobe instances
    present in kretprobe object and kretprobe hash table. We will have
    two locks, one lock for protecting kretprobe hash table and another
    lock for kretporbe object.

    2) We hold lock present in kretprobe object while we modify kretprobe
    instance in kretprobe object and we hold per-hash-list lock while
    modifying kretprobe instances present in that hash list. To prevent
    deadlock, we never grab a per-hash-list lock while holding a kretprobe
    lock.

    3) We can remove used_instances from struct kretprobe, as we can
    track used instances of kretprobe instances using kretprobe hash
    table.

    Time duration for kernel compilation ("make -j 8") on a 8-way ppc64 system
    with return probes set on all systemcalls looks like this.

    cacheline non-cacheline Un-patched kernel
    aligned patch aligned patch
    ===============================================================================
    real 9m46.784s 9m54.412s 10m2.450s
    user 40m5.715s 40m7.142s 40m4.273s
    sys 2m57.754s 2m58.583s 3m17.430s
    ===========================================================

    Time duration for kernel compilation ("make -j 8) on the same system, when
    kernel is not probed.
    =========================
    real 9m26.389s
    user 40m8.775s
    sys 2m7.283s
    =========================

    Signed-off-by: Srinivasa DS
    Signed-off-by: Jim Keniston
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Cc: Masami Hiramatsu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Srinivasa D S
     

24 Jun, 2008

1 commit

  • Allow clean use of get_kprobe() outside of core kprobe code. Ftrace makes use
    of get_kprobe to identify probes installed on mcount call-sites.

    Signed-off-by: Abhishek Sagar
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Masami Hiramatsu
    Cc: jkenisto@us.ibm.com
    Cc: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Abhishek Sagar
     

28 Apr, 2008

4 commits

  • Introduce unregister_/register_jprobes() for jprobe batch registration.

    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Jim Keniston
    Cc: Prasanna S Panchamukhi
    Cc: Shaohua Li
    Cc: David Miller
    Cc: "Frank Ch. Eigler"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Introduce unregister_/register_kretprobes() for kretprobe batch registration.

    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Jim Keniston
    Cc: Prasanna S Panchamukhi
    Cc: Shaohua Li
    Cc: David Miller
    Cc: "Frank Ch. Eigler"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Introduce unregister_/register_kprobes() for kprobe batch registration. This
    can reduce waiting time for synchronized_sched() when a lot of probes have to
    be unregistered at once.

    Signed-off-by: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Jim Keniston
    Cc: Prasanna S Panchamukhi
    Cc: Shaohua Li
    Cc: David Miller
    Cc: "Frank Ch. Eigler"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Prohibit users from probing preempt_schedule(). One way of prohibiting the
    user from probing functions is by marking such functions with __kprobes. But
    this method doesn't work for those functions, which are already marked to
    different section like preempt_schedule() (belongs to __sched section). So we
    use blacklist approach to refuse user from probing these functions.

    In blacklist approach we populate the blacklisted function's starting address
    and its size in kprobe_blacklist structure. Then we verify the user specified
    address against start and end of the blacklisted function. So any attempt to
    register probe on blacklisted functions will be rejected.

    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Srinivasa DS
    Signed-off-by: Ananth N Mavinakayanahalli
    Signed-off-by: Jim Keniston
    Cc: Dave Hansen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Srinivasa Ds
     

05 Mar, 2008

1 commit

  • Add CONFIG_HAVE_KRETPROBES to the arch//Kconfig file for relevant
    architectures with kprobes support. This facilitates easy handling of
    in-kernel modules (like samples/kprobes/kretprobe_example.c) that depend on
    kretprobes being present in the kernel.

    Thanks to Sam Ravnborg for helping make the patch more lean.

    Per Mathieu's suggestion, added CONFIG_KRETPROBES and fixed up dependencies.

    Signed-off-by: Ananth N Mavinakayanahalli
    Acked-by: Mathieu Desnoyers
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ananth N Mavinakayanahalli
     

07 Feb, 2008

1 commit

  • Provide support to add an optional user defined callback to be run at
    function entry of a kretprobe'd function. Also modify the kprobe smoke
    tests to include an entry-handler during the kretprobe sanity test.

    Signed-off-by: Abhishek Sagar
    Cc: Prasanna S Panchamukhi
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Acked-by: Jim Keniston
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Abhishek Sagar
     

30 Jan, 2008

1 commit

  • Here is a quick and naive smoke test for kprobes. This is intended to
    just verify if some unrelated change broke the *probes subsystem. It is
    self contained, architecture agnostic and isn't of any great use by itself.

    This needs to be built in the kernel and runs a basic set of tests to
    verify if kprobes, jprobes and kretprobes run fine on the kernel. In case
    of an error, it'll print out a message with a "BUG" prefix.

    This is a start; we intend to add more tests to this bucket over time.

    Thanks to Jim Keniston and Masami Hiramatsu for comments and suggestions.

    Tested on x86 (32/64) and powerpc.

    Signed-off-by: Ananth N Mavinakayanahalli
    Acked-by: Masami Hiramatsu
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ananth N Mavinakayanahalli
     

17 Oct, 2007

1 commit

  • Introduce architecture dependent kretprobe blacklists to prohibit users
    from inserting return probes on the function in which kprobes can be
    inserted but kretprobes can not.

    This patch also removes "__kprobes" mark from "__switch_to" on x86_64 and
    registers "__switch_to" to the blacklist on x86-64, because that mark is to
    prohibit user from inserting only kretprobe.

    Signed-off-by: Masami Hiramatsu
    Cc: Prasanna S Panchamukhi
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     

20 Jul, 2007

3 commits

  • I realise jprobes are a razor-blades-included type of interface, but that
    doesn't mean we can't try and make them safer to use. This guy I know once
    wrote code like this:

    struct jprobe jp = { .kp.symbol_name = "foo", .entry = "jprobe_foo" };

    And then his kernel exploded. Oops.

    This patch adds an arch hook, arch_deref_entry_point() (I don't like it
    either) which takes the void * in a struct jprobe, and gives back the text
    address that it represents.

    We can then use that in register_jprobe() to check that the entry point we're
    passed is actually in the kernel text, rather than just some random value.

    Signed-off-by: Michael Ellerman
    Cc: Prasanna S Panchamukhi
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Ellerman
     
  • AFAICT now that jprobe.entry is a void *, JPROBE_ENTRY doesn't do anything
    useful - so remove it ..

    I've left a do-nothing version so that out-of-tree jprobes code will still
    compile without modifications.

    Signed-off-by: Michael Ellerman
    Cc: Prasanna S Panchamukhi
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Ellerman
     
  • Currently jprobe.entry is a kprobe_opcode_t *, but that's a lie. On some
    platforms it doesn't point to an opcode at all, it points to a function
    descriptor.

    It's really a pointer to something that the arch code can turn into a function
    entry point. And that's what actually happens, none of the generic code ever
    looks at jprobe.entry, it's only ever dereferenced by arch code.

    So just make it a void *.

    Signed-off-by: Michael Ellerman
    Cc: Prasanna S Panchamukhi
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Ellerman
     

09 May, 2007

4 commits

  • This patch provides a debugfs knob to turn kprobes on/off

    o A new file /debug/kprobes/enabled indicates if kprobes is enabled or
    not (default enabled)
    o Echoing 0 to this file will disarm all installed probes
    o Any new probe registration when disabled will register the probe but
    not arm it. A message will be printed out in such a case.
    o When a value 1 is echoed to the file, all probes (including ones
    registered in the intervening period) will be enabled
    o Unregistration will happen irrespective of whether probes are globally
    enabled or not.
    o Update Documentation/kprobes.txt to reflect these changes. While there
    also update the doc to make it current.

    We are also looking at providing sysrq key support to tie to the disabling
    feature provided by this patch.

    [akpm@linux-foundation.org: Use bool like a bool!]
    [akpm@linux-foundation.org: add printk facility levels]
    [cornelia.huck@de.ibm.com: Add the missing arch_trampoline_kprobe() for s390]
    Signed-off-by: Ananth N Mavinakayanahalli
    Signed-off-by: Srinivasa DS
    Signed-off-by: Cornelia Huck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ananth N Mavinakayanahalli
     
  • - consolidate duplicate code in all arch_prepare_kretprobe instances
    into common code
    - replace various odd helpers that use hlist_for_each_entry to get
    the first elemenet of a list with either a hlist_for_each_entry_save
    or an opencoded access to the first element in the caller
    - inline add_rp_inst into it's only remaining caller
    - use kretprobe_inst_table_head instead of opencoding it

    Signed-off-by: Christoph Hellwig
    Cc: Prasanna S Panchamukhi
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • In certain cases like when the real return address can't be found or when
    the number of tracked calls to a kretprobed function is less than the
    number of returns, we may not be able to find the correct return address
    after processing a kretprobe. Currently we just do a BUG_ON, but no
    information is provided about the actual failing kretprobe.

    Print out details of the kretprobe before calling BUG().

    Signed-off-by: Ananth N Mavinakayanahalli
    Cc: Prasanna S Panchamukhi
    Cc: Jim Keniston
    Cc: Anil S Keshavamurthy
    Cc: Maneesh Soni
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ananth N Mavinakayanahalli
     
  • Kprobes doesn't scribble the kprobe.symbol_name field. Its only set by the
    module when registering the probe. Modules that exercise good hygiene
    using the "const" qualifier will see warnings...

    warning: assignment discards qualifiers from pointer target type

    Make struct kprobe.symbol_name const char *

    Signed-off-by: Ananth N Mavinakayanahalli
    Signed-off-by: Jim Keniston
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ananth N Mavinakayanahalli
     

08 Dec, 2006

1 commit

  • When we are unregistering a kprobe-booster, we can't release its
    instruction buffer immediately on the preemptive kernel, because some
    processes might be preempted on the buffer. The freeze_processes() and
    thaw_processes() functions can clean most of processes up from the buffer.
    There are still some non-frozen threads who have the PF_NOFREEZE flag. If
    those threads are sleeping (not preempted) at the known place outside the
    buffer, we can ensure safety of freeing.

    However, the processing of this check routine takes a long time. So, this
    patch introduces the garbage collection mechanism of insn_slot. It also
    introduces the "dirty" flag to free_insn_slot because of efficiency.

    The "clean" instruction slots (dirty flag is cleared) are released
    immediately. But the "dirty" slots which are used by boosted kprobes, are
    marked as garbages. collect_garbage_slots() will be invoked to release
    "dirty" slots if there are more than INSNS_PER_PAGE garbage slots or if
    there are no unused slots.

    Cc: "Keshavamurthy, Anil S"
    Cc: Ananth N Mavinakayanahalli
    Cc: "bibo,mao"
    Cc: Prasanna S Panchamukhi
    Cc: Yumiko Sugita
    Cc: Satoshi Oshima
    Cc: Hideo Aoki
    Signed-off-by: Masami Hiramatsu
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     

02 Oct, 2006

2 commits

  • kprobe_flush_task() possibly calls kfree function during holding
    kretprobe_lock spinlock, if kfree function is probed by kretprobe that will
    incur spinlock deadlock. This patch moves kfree function out scope of
    kretprobe_lock.

    Signed-off-by: bibo, mao
    Signed-off-by: Ananth N Mavinakayanahalli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    bibo,mao
     
  • In an effort to make kprobe modules more portable, here is a patch that:

    o Introduces the "symbol_name" field to struct kprobe.
    The symbol->address resolution now happens in the kernel in an
    architecture agnostic manner. 64-bit powerpc users no longer have
    to specify the ".symbols"
    o Introduces the "offset" field to struct kprobe to allow a user to
    specify an offset into a symbol.
    o The legacy mechanism of specifying the kprobe.addr is still supported.
    However, if both the kprobe.addr and kprobe.symbol_name are specified,
    probe registration fails with an -EINVAL.
    o The symbol resolution code uses kallsyms_lookup_name(). So
    CONFIG_KPROBES now depends on CONFIG_KALLSYMS
    o Apparantly kprobe modules were the only legitimate out-of-tree user of
    the kallsyms_lookup_name() EXPORT. Now that the symbol resolution
    happens in-kernel, remove the EXPORT as suggested by Christoph Hellwig
    o Modify tcp_probe.c that uses the kprobe interface so as to make it
    work on multiple platforms (in its earlier form, the code wouldn't
    work, say, on powerpc)

    Signed-off-by: Ananth N Mavinakayanahalli
    Signed-off-by: Prasanna S Panchamukhi
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ananth N Mavinakayanahalli
     

26 Apr, 2006

1 commit


23 Mar, 2006

1 commit

  • Semaphore to mutex conversion.

    The conversion was generated via scripts, and the result was validated
    automatically via a script as well.

    Signed-off-by: Ingo Molnar
    Acked-by: Anil S Keshavamurthy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar