From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754954Ab0K2QNg (ORCPT ); Mon, 29 Nov 2010 11:13:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56669 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754653Ab0K2QNf (ORCPT ); Mon, 29 Nov 2010 11:13:35 -0500 Date: Mon, 29 Nov 2010 17:11:03 +0100 From: Andrea Arcangeli To: Daisuke Nishimura Cc: linux-mm@kvack.org, Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, Marcelo Tosatti , Adam Litke , Avi Kivity , Hugh Dickins , Rik van Riel , Mel Gorman , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , bpicco@redhat.com, KOSAKI Motohiro , Balbir Singh , "Michael S. Tsirkin" , Peter Zijlstra , Johannes Weiner , Chris Mason , Borislav Petkov Subject: Re: [PATCH 53 of 66] add numa awareness to hugepage allocations Message-ID: <20101129161103.GE24474@random.random> References: <223ee926614158fc1353.1288798108@v2.random> <20101129143801.abef5228.nishimura@mxp.nes.nec.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101129143801.abef5228.nishimura@mxp.nes.nec.co.jp> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 29, 2010 at 02:38:01PM +0900, Daisuke Nishimura wrote: > I think this should be: > > if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) { > #ifdef CONFIG_NUMA > put_page(new_page); > #endif > goto out; > } Hmm no, the change you suggest would generate memory corruption with use after free. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with SMTP id 8C1758D0013 for ; Mon, 29 Nov 2010 11:12:27 -0500 (EST) Date: Mon, 29 Nov 2010 17:11:03 +0100 From: Andrea Arcangeli Subject: Re: [PATCH 53 of 66] add numa awareness to hugepage allocations Message-ID: <20101129161103.GE24474@random.random> References: <223ee926614158fc1353.1288798108@v2.random> <20101129143801.abef5228.nishimura@mxp.nes.nec.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101129143801.abef5228.nishimura@mxp.nes.nec.co.jp> Sender: owner-linux-mm@kvack.org To: Daisuke Nishimura Cc: linux-mm@kvack.org, Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, Marcelo Tosatti , Adam Litke , Avi Kivity , Hugh Dickins , Rik van Riel , Mel Gorman , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , bpicco@redhat.com, KOSAKI Motohiro , Balbir Singh , "Michael S. Tsirkin" , Peter Zijlstra , Johannes Weiner , Chris Mason , Borislav Petkov List-ID: On Mon, Nov 29, 2010 at 02:38:01PM +0900, Daisuke Nishimura wrote: > I think this should be: > > if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) { > #ifdef CONFIG_NUMA > put_page(new_page); > #endif > goto out; > } Hmm no, the change you suggest would generate memory corruption with use after free. -- 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 policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: email@kvack.org