From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: [BUG] Invalid return address of mmap() followed by mbind() in multithreaded context Date: Sat, 18 Jun 2011 20:12:32 +0200 Message-ID: <20110618181232.GI16236@one.firstfloor.org> References: <4DFB710D.7000902@cslab.ece.ntua.gr> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <4DFB710D.7000902@cslab.ece.ntua.gr> Sender: owner-linux-mm@kvack.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Vasileios Karakasis Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-numa@vger.kernel.org > for (i = 0; i < NR_ITER; i++) { > addr = mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE, > MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); > if (addr == (void *) -1) { > assert(0 && "mmap failed"); > } > *addr = 0; > > err = mbind(addr, PAGE_SIZE, MPOL_BIND, &node, sizeof(node), 0); mbind() can be only done before the first touch. you're not actually testing numa policy. -andi -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752134Ab1FRSMg (ORCPT ); Sat, 18 Jun 2011 14:12:36 -0400 Received: from one.firstfloor.org ([213.235.205.2]:54845 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752072Ab1FRSMd (ORCPT ); Sat, 18 Jun 2011 14:12:33 -0400 Date: Sat, 18 Jun 2011 20:12:32 +0200 From: Andi Kleen To: Vasileios Karakasis Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-numa@vger.kernel.org Subject: Re: [BUG] Invalid return address of mmap() followed by mbind() in multithreaded context Message-ID: <20110618181232.GI16236@one.firstfloor.org> References: <4DFB710D.7000902@cslab.ece.ntua.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DFB710D.7000902@cslab.ece.ntua.gr> User-Agent: Mutt/1.4.2.2i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > for (i = 0; i < NR_ITER; i++) { > addr = mmap(0, PAGE_SIZE, PROT_READ | PROT_WRITE, > MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); > if (addr == (void *) -1) { > assert(0 && "mmap failed"); > } > *addr = 0; > > err = mbind(addr, PAGE_SIZE, MPOL_BIND, &node, sizeof(node), 0); mbind() can be only done before the first touch. you're not actually testing numa policy. -andi