From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932177AbdJWWKJ (ORCPT ); Mon, 23 Oct 2017 18:10:09 -0400 Received: from mga14.intel.com ([192.55.52.115]:37134 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbdJWWKH (ORCPT ); Mon, 23 Oct 2017 18:10:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,424,1503385200"; d="scan'208";a="164008356" Subject: Re: [RFC] mmap(MAP_CONTIG) To: Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org References: <21f1ec96-2822-1189-1c95-79a2bb491571@oracle.com> Cc: Marek Szyprowski , Michal Nazarewicz , "Aneesh Kumar K.V" , Joonsoo Kim , Guy Shattah , Christoph Lameter From: Dave Hansen Message-ID: Date: Mon, 23 Oct 2017 15:10:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <21f1ec96-2822-1189-1c95-79a2bb491571@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/03/2017 04:56 PM, Mike Kravetz wrote: > mmap(MAP_CONTIG) would have the following semantics: > - The entire mapping (length size) would be backed by physically contiguous > pages. > - If 'length' physically contiguous pages can not be allocated, then mmap > will fail. > - MAP_CONTIG only works with MAP_ANONYMOUS mappings. > - MAP_CONTIG will lock the associated pages in memory. As such, the same > privileges and limits that apply to mlock will also apply to MAP_CONTIG. > - A MAP_CONTIG mapping can not be expanded. Do you also need to lock out the NUMA migration APIs somehow? What about KSM (or does it already ignore VM_LOCKED)? > - At fork time, private MAP_CONTIG mappings will be converted to regular > (non-MAP_CONTIG) mapping in the child. As such a COW fault in the child > will not require a contiguous allocation. Maybe we should just define it as acting as if it had MADV_DONTFORK set on it, and also that it doesn't allow MADV_DONTFORK to be called on it.