From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail144.messagelabs.com (mail144.messagelabs.com [216.82.254.51]) by kanga.kvack.org (Postfix) with ESMTP id 652536B004D for ; Tue, 18 Oct 2011 13:22:15 -0400 (EDT) Received: from /spool/local by e5.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 18 Oct 2011 13:10:04 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9IH80tC2371642 for ; Tue, 18 Oct 2011 13:08:00 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9IH7xIM013305 for ; Tue, 18 Oct 2011 15:08:00 -0200 Date: Tue, 18 Oct 2011 22:17:39 +0530 From: Srikar Dronamraju Subject: Re: [PATCH 2/X] uprobes: write_opcode() needs put_page(new_page) unconditionally Message-ID: <20111018164739.GI11831@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20110920115938.25326.93059.sendpatchset@srdronam.in.ibm.com> <20111015190007.GA30243@redhat.com> <20111015190057.GC30243@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20111015190057.GC30243@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: Oleg Nesterov Cc: Peter Zijlstra , Ingo Molnar , Steven Rostedt , Linux-mm , Arnaldo Carvalho de Melo , Linus Torvalds , Jonathan Corbet , Masami Hiramatsu , Hugh Dickins , Christoph Hellwig , Ananth N Mavinakayanahalli , Thomas Gleixner , Andi Kleen , Andrew Morton , Jim Keniston , Roland McGrath , LKML > Every write_opcode()->__replace_page() leaks the new page on success. > > We have the reference after alloc_page_vma(), then __replace_page() > does another get_page() for the new mapping, we need put_page(new_page) > in any case. > > Alternatively we could remove __replace_page()->get_page() but it is > better to change write_opcode(). This way it is simpler to unify the > code with ksm.c:replace_page() and we can simplify the error handling > in write_opcode(), the patch simply adds a single page_cache_release() > under "unlock_out" label. I have folded this change and your other suggested changes into my patches. -- Thanks and Regards Srikar -- 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