From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlastimil Babka Subject: Re: [patch v2 2/3] mm, thp: really limit transparent hugepage allocation to local node Date: Mon, 02 Mar 2015 14:47:21 +0100 Message-ID: <54F469E9.7050303@suse.cz> References: Mime-Version: 1.0 Content-Transfer-Encoding: base64 Return-path: In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-yBygre7rU0TnMu66kgdUjQ@public.gmane.org Sender: "dev" Content-Type: text/plain; charset="us-ascii"; format="flowed" To: David Rientjes , Andrew Morton Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, Greg Thelen , netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Pekka Enberg , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Li Zefan , Mel Gorman , Johannes Weiner , Christoph Lameter , Joonsoo Kim T24gMDIvMjcvMjAxNSAxMToxNyBQTSwgRGF2aWQgUmllbnRqZXMgd3JvdGU6Cj4gQ29tbWl0IDA3 N2ZjZjExNmM4YyAoIm1tL3RocDogYWxsb2NhdGUgdHJhbnNwYXJlbnQgaHVnZXBhZ2VzIG9uIGxv Y2FsCj4gbm9kZSIpIHJlc3RydWN0dXJlZCBhbGxvY19odWdlcGFnZV92bWEoKSB3aXRoIHRoZSBp bnRlbnQgb2Ygb25seQo+IGFsbG9jYXRpbmcgdHJhbnNwYXJlbnQgaHVnZXBhZ2VzIGxvY2FsbHkg d2hlbiB0aGVyZSB3YXMgbm90IGFuIGVmZmVjdGl2ZQo+IGludGVybGVhdmUgbWVtcG9saWN5Lgo+ Cj4gYWxsb2NfcGFnZXNfZXhhY3Rfbm9kZSgpIGRvZXMgbm90IGxpbWl0IHRoZSBhbGxvY2F0aW9u IHRvIHRoZSBzaW5nbGUKPiBub2RlLCBob3dldmVy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d2l0Y2gub3JnCmh0dHA6Ly9vcGVudnN3aXRjaC5vcmcvbWFp bG1hbi9saXN0aW5mby9kZXYK From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by kanga.kvack.org (Postfix) with ESMTP id 2D1276B006C for ; Mon, 2 Mar 2015 08:47:24 -0500 (EST) Received: by wibbs8 with SMTP id bs8so14933793wib.4 for ; Mon, 02 Mar 2015 05:47:23 -0800 (PST) Received: from mx2.suse.de (cantor2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id eb1si915549wib.34.2015.03.02.05.47.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Mar 2015 05:47:22 -0800 (PST) Message-ID: <54F469E9.7050303@suse.cz> Date: Mon, 02 Mar 2015 14:47:21 +0100 From: Vlastimil Babka MIME-Version: 1.0 Subject: Re: [patch v2 2/3] mm, thp: really limit transparent hugepage allocation to local node References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes , Andrew Morton Cc: Christoph Lameter , Pekka Enberg , Joonsoo Kim , Johannes Weiner , Mel Gorman , Pravin Shelar , Jarno Rajahalme , Li Zefan , Greg Thelen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, cgroups@vger.kernel.org, dev@openvswitch.org On 02/27/2015 11:17 PM, David Rientjes wrote: > Commit 077fcf116c8c ("mm/thp: allocate transparent hugepages on local > node") restructured alloc_hugepage_vma() with the intent of only > allocating transparent hugepages locally when there was not an effective > interleave mempolicy. > > alloc_pages_exact_node() does not limit the allocation to the single > node, however, but rather prefers it. This is because __GFP_THISNODE is > not set which would cause the node-local nodemask to be passed. Without > it, only a nodemask that prefers the local node is passed. > > Fix this by passing __GFP_THISNODE and falling back to small pages when > the allocation fails. > > Commit 9f1b868a13ac ("mm: thp: khugepaged: add policy for finding target > node") suffers from a similar problem for khugepaged, which is also > fixed. > > Fixes: 077fcf116c8c ("mm/thp: allocate transparent hugepages on local node") > Fixes: 9f1b868a13ac ("mm: thp: khugepaged: add policy for finding target node") > Signed-off-by: David Rientjes Acked-by: Vlastimil Babka -- 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/ . 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 S1754570AbbCBNr0 (ORCPT ); Mon, 2 Mar 2015 08:47:26 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59628 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752594AbbCBNrX (ORCPT ); Mon, 2 Mar 2015 08:47:23 -0500 Message-ID: <54F469E9.7050303@suse.cz> Date: Mon, 02 Mar 2015 14:47:21 +0100 From: Vlastimil Babka User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: David Rientjes , Andrew Morton CC: Christoph Lameter , Pekka Enberg , Joonsoo Kim , Johannes Weiner , Mel Gorman , Pravin Shelar , Jarno Rajahalme , Li Zefan , Greg Thelen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, cgroups@vger.kernel.org, dev@openvswitch.org Subject: Re: [patch v2 2/3] mm, thp: really limit transparent hugepage allocation to local node References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/27/2015 11:17 PM, David Rientjes wrote: > Commit 077fcf116c8c ("mm/thp: allocate transparent hugepages on local > node") restructured alloc_hugepage_vma() with the intent of only > allocating transparent hugepages locally when there was not an effective > interleave mempolicy. > > alloc_pages_exact_node() does not limit the allocation to the single > node, however, but rather prefers it. This is because __GFP_THISNODE is > not set which would cause the node-local nodemask to be passed. Without > it, only a nodemask that prefers the local node is passed. > > Fix this by passing __GFP_THISNODE and falling back to small pages when > the allocation fails. > > Commit 9f1b868a13ac ("mm: thp: khugepaged: add policy for finding target > node") suffers from a similar problem for khugepaged, which is also > fixed. > > Fixes: 077fcf116c8c ("mm/thp: allocate transparent hugepages on local node") > Fixes: 9f1b868a13ac ("mm: thp: khugepaged: add policy for finding target node") > Signed-off-by: David Rientjes Acked-by: Vlastimil Babka