uprobes: Remove redundant lock_page/unlock_page
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Fri, 1 Jun 2012 09:19:50 +0000 (14:49 +0530)
committerOleg Nesterov <oleg@redhat.com>
Tue, 28 Aug 2012 16:21:15 +0000 (18:21 +0200)
Since read_opcode() reads from the referenced page and doesnt modify
the page contents nor the page attributes, there is no need to lock
the page.

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
kernel/events/uprobes.c

index c08a22d02f7268ffd5e5516fb9d67182d22e5de8..7cff24c60dd7107a335ed8db637dafb154c66d18 100644 (file)
@@ -280,12 +280,10 @@ static int read_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_
        if (ret <= 0)
                return ret;
 
-       lock_page(page);
        vaddr_new = kmap_atomic(page);
        vaddr &= ~PAGE_MASK;
        memcpy(opcode, vaddr_new + vaddr, UPROBE_SWBP_INSN_SIZE);
        kunmap_atomic(vaddr_new);
-       unlock_page(page);
 
        put_page(page);