mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[PATCH] Kprobes: Use RCU for (un)register synchronization - base changes
Changes to the base kprobes infrastructure to use RCU for synchronization during kprobe registration and unregistration. These changes coupled with the arch kprobe changes (next in series): a. serialize registration and unregistration of kprobes. b. enable lockless execution of handlers. Handlers can now run in parallel. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
e7a510f92c
commit
3516a46042
2 changed files with 46 additions and 66 deletions
|
@ -34,6 +34,8 @@
|
|||
#include <linux/notifier.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/rcupdate.h>
|
||||
|
||||
#include <asm/kprobes.h>
|
||||
|
||||
|
@ -146,10 +148,7 @@ struct kretprobe_instance {
|
|||
};
|
||||
|
||||
#ifdef CONFIG_KPROBES
|
||||
/* Locks kprobe: irq must be disabled */
|
||||
void lock_kprobes(void);
|
||||
void unlock_kprobes(void);
|
||||
|
||||
extern spinlock_t kretprobe_lock;
|
||||
extern int arch_prepare_kprobe(struct kprobe *p);
|
||||
extern void arch_copy_kprobe(struct kprobe *p);
|
||||
extern void arch_arm_kprobe(struct kprobe *p);
|
||||
|
@ -160,7 +159,7 @@ extern void show_registers(struct pt_regs *regs);
|
|||
extern kprobe_opcode_t *get_insn_slot(void);
|
||||
extern void free_insn_slot(kprobe_opcode_t *slot);
|
||||
|
||||
/* Get the kprobe at this addr (if any). Must have called lock_kprobes */
|
||||
/* Get the kprobe at this addr (if any) - called under a rcu_read_lock() */
|
||||
struct kprobe *get_kprobe(void *addr);
|
||||
struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue