uprobes: Optimize is_swbp_at_addr() for current->mm
authorOleg Nesterov <oleg@redhat.com>
Tue, 29 May 2012 19:27:44 +0000 (21:27 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 6 Jun 2012 15:13:59 +0000 (17:13 +0200)
commitc00b275043adc14d668f36266b890f0c53d46640
treecdb6db30f3f0d18049079d7a014f6561e056eb06
parent436d03faf6961b30e13b2d0967aea9d772d6cf44
uprobes: Optimize is_swbp_at_addr() for current->mm

Change is_swbp_at_addr() to try to avoid the costly
read_opcode() if mm == current->mm, __copy_from_user_inatomic()
should succeed in the likely case.

Currently this optimization is not important, but we are going
to add more is_swbp_at_addr(current->mm) callers.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anton Arapov <anton@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120529192744.GA8057@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/uprobes.c