Skip to content

Commit

Permalink
uprobes: Kill write_opcode()->lock_page(new_page)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Jul 30, 2012
1 parent c517ee7 commit 089ba99
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions kernel/events/uprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,7 @@ static int write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm,
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);
Expand Down

0 comments on commit 089ba99

Please sign in to comment.