[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130325103136.GF8163@bandura.brq.redhat.com>
Date: Mon, 25 Mar 2013 11:31:36 +0100
From: Anton Arapov <anton@...hat.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
LKML <linux-kernel@...r.kernel.org>,
Josh Stone <jistone@...hat.com>,
Frank Eigler <fche@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...e.hu>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
adrian.m.negreanu@...el.com, Torsten.Polle@....de
Subject: Re: [PATCH 5/5] uprobes: Change write_opcode() to use copy_*page()
On Sun, Mar 24, 2013 at 07:21:25PM +0100, Oleg Nesterov wrote:
> Change write_opcode() to use copy_highpage() + copy_to_page()
> and simplify the code.
>
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>
> ---
> kernel/events/uprobes.c | 12 ++----------
> 1 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
> index 9d943f7..72f03d4 100644
> --- a/kernel/events/uprobes.c
> +++ b/kernel/events/uprobes.c
> @@ -232,7 +232,6 @@ static int write_opcode(struct mm_struct *mm, unsigned long vaddr,
> uprobe_opcode_t opcode)
> {
> struct page *old_page, *new_page;
> - void *vaddr_old, *vaddr_new;
> struct vm_area_struct *vma;
> int ret;
>
> @@ -253,15 +252,8 @@ retry:
>
> __SetPageUptodate(new_page);
>
> - /* copy the page now that we've got it stable */
> - vaddr_old = kmap_atomic(old_page);
> - vaddr_new = kmap_atomic(new_page);
> -
> - memcpy(vaddr_new, vaddr_old, PAGE_SIZE);
> - memcpy(vaddr_new + (vaddr & ~PAGE_MASK), &opcode, UPROBE_SWBP_INSN_SIZE);
> -
> - kunmap_atomic(vaddr_new);
> - kunmap_atomic(vaddr_old);
> + copy_highpage(new_page, old_page);
> + copy_to_page(new_page, vaddr, &opcode, UPROBE_SWBP_INSN_SIZE);
>
> ret = anon_vma_prepare(vma);
> if (ret)
> --
> 1.5.5.1
>
Acked-by: Anton Arapov <anton@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists