From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 7F0666B038A for ; Wed, 15 Mar 2017 12:50:36 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id b140so5942703wme.3 for ; Wed, 15 Mar 2017 09:50:36 -0700 (PDT) Received: from mail-wr0-x229.google.com (mail-wr0-x229.google.com. [2a00:1450:400c:c0c::229]) by mx.google.com with ESMTPS id k62si1127574wmb.93.2017.03.15.09.50.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Mar 2017 09:50:35 -0700 (PDT) Received: by mail-wr0-x229.google.com with SMTP id l37so15075275wrc.1 for ; Wed, 15 Mar 2017 09:50:35 -0700 (PDT) From: Avi Kivity Subject: MAP_POPULATE vs. MADV_HUGEPAGES Message-ID: Date: Wed, 15 Mar 2017 18:50:32 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org, linux-mm@kvack.org A user is trying to allocate 1TB of anonymous memory in parallel on 48 cores (4 NUMA nodes). The kernel ends up spinning in isolate_freepages_block(). I thought to help it along by using MAP_POPULATE, but then my MADV_HUGEPAGE won't be seen until after mmap() completes, with pages already populated. Are MAP_POPULATE and MADV_HUGEPAGE mutually exclusive? Is my only option to serialize those memory allocations, and fault in those pages manually? Or perhaps use mlock()? -- 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