From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751304AbdJDRjR (ORCPT ); Wed, 4 Oct 2017 13:39:17 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:40986 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779AbdJDRjP (ORCPT ); Wed, 4 Oct 2017 13:39:15 -0400 Subject: Re: [RFC] mmap(MAP_CONTIG) To: Christopher Lameter , Anshuman Khandual Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Marek Szyprowski , Michal Nazarewicz , "Aneesh Kumar K.V" , Joonsoo Kim , Guy Shattah References: <21f1ec96-2822-1189-1c95-79a2bb491571@oracle.com> <97c81533-5206-b130-1aeb-c5b9bfd93287@linux.vnet.ibm.com> From: Mike Kravetz Message-ID: <434a5870-0115-b8ab-bd6c-b7f4db847dc4@oracle.com> Date: Wed, 4 Oct 2017 10:38:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04/2017 09:05 AM, Christopher Lameter wrote: > On Wed, 4 Oct 2017, Anshuman Khandual wrote: > >>> - Using 'pre-allocated' pages in the fault paths may be intrusive. >> >> But we have already faulted in all of them for the mapping and they >> are also locked. Hence there should not be any page faults any more >> for the VMA. Am I missing something here ? > > The PTEs may be torn down and have to reestablished through a page faults. > Page faults would not allocate memory. > >> I am still wondering why wait till fault time not pre fault all of them >> and populate the page tables. > > They are populated but some processes (swap and migration) may tear them > down. As mentioned in my reply to Anshuman, the mention of fault paths here may be a source of confusion. I would expect the entire mapping to be populated at mmap time, and the pages locked. Therefore, there should be no swap or migration. -- Mike Kravetz