From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by kanga.kvack.org (Postfix) with ESMTP id 0C55C6B004A for ; Mon, 13 Jun 2011 13:02:24 -0400 (EDT) Date: Mon, 13 Jun 2011 19:00:20 +0200 From: Oleg Nesterov 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> Sender: owner-linux-mm@kvack.org List-ID: 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 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org