uprobes: Kill write_opcode()->lock_page(new_page)
authorOleg Nesterov <oleg@redhat.com>
Sun, 29 Jul 2012 18:22:18 +0000 (20:22 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 30 Jul 2012 09:27:19 +0000 (11:27 +0200)
write_opcode() does lock_page(new_page) for no reason. Nobody
can see this page until __replace_page() exposes it under ptl
lock, and we do nothing with this page after pte_unmap_unlock().

If nothing else, the similar code in do_wp_page() doesn't lock
the new page for page_add_new_anon_rmap/set_pte_at_notify.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar.vnet.ibm.com>
Cc: Anton Arapov <anton@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20120729182218.GA20315@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/uprobes.c

index 6fda7996892ba2703201fae6bf1cafde5bc14627..23c562b7fc2eb92d5fceeea7894241764837c2eb 100644 (file)
@@ -239,9 +239,7 @@ retry:
        if (ret)
                goto unlock_out;
 
-       lock_page(new_page);
        ret = __replace_page(vma, vaddr, old_page, new_page);
-       unlock_page(new_page);
 
 unlock_out:
        unlock_page(old_page);