Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754269Ab1FMRCx (ORCPT ); Mon, 13 Jun 2011 13:02:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41596 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753966Ab1FMRCw (ORCPT ); Mon, 13 Jun 2011 13:02:52 -0400 Date: Mon, 13 Jun 2011 19:00:20 +0200 From: Oleg Nesterov To: Srikar Dronamraju Cc: Peter Zijlstra , Ingo Molnar , Steven Rostedt , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Masami Hiramatsu , Hugh Dickins , Christoph Hellwig , Andi Kleen , Thomas Gleixner , Jonathan Corbet , Andrew Morton , Jim Keniston , Roland McGrath , Ananth N Mavinakayanahalli , LKML Subject: Re: [PATCH v4 3.0-rc2-tip 2/22] 2: uprobes: Breakground page replacement. Message-ID: <20110613170020.GA27137@redhat.com> References: <20110607125804.28590.92092.sendpatchset@localhost6.localdomain6> <20110607125835.28590.25476.sendpatchset@localhost6.localdomain6> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110607125835.28590.25476.sendpatchset@localhost6.localdomain6> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 964 Lines: 28 On 06/07, Srikar Dronamraju wrote: > > +static int write_opcode(struct task_struct *tsk, struct uprobe * uprobe, > + unsigned long vaddr, uprobe_opcode_t opcode) > +{ > + struct page *old_page, *new_page; > + void *vaddr_old, *vaddr_new; > + struct vm_area_struct *vma; > + unsigned long addr; > + int ret; > + > + /* Read the page with vaddr into memory */ > + ret = get_user_pages(tsk, tsk->mm, vaddr, 1, 1, 1, &old_page, &vma); Sorry if this was already discussed... But why we are using FOLL_WRITE here? We are not going to write into this page, and this provokes the unnecessary cow, no? Also. This is called under down_read(mmap_sem), can't we race with access_process_vm() modifying the same memory? Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/