From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751987AbcBLQzW (ORCPT ); Fri, 12 Feb 2016 11:55:22 -0500 Received: from mga03.intel.com ([134.134.136.65]:4234 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbcBLQzT (ORCPT ); Fri, 12 Feb 2016 11:55:19 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,436,1449561600"; d="scan'208";a="882979849" Subject: Re: [PATCHv2 04/28] mm: make remove_migration_ptes() beyond mm/migration.c To: "Kirill A. Shutemov" , Hugh Dickins , Andrea Arcangeli , Andrew Morton References: <1455200516-132137-1-git-send-email-kirill.shutemov@linux.intel.com> <1455200516-132137-5-git-send-email-kirill.shutemov@linux.intel.com> Cc: Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Jerome Marchand , Yang Shi , Sasha Levin , linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Dave Hansen Message-ID: <56BE0E62.60806@intel.com> Date: Fri, 12 Feb 2016 08:54:58 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455200516-132137-5-git-send-email-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/11/2016 06:21 AM, Kirill A. Shutemov wrote > We also shouldn't try to mlock() pte-mapped huge pages: pte-mapeed THP > pages are never mlocked. That's kinda subtle. Can you explain more? If we did the following: ptr = mmap(NULL, 512*PAGE_SIZE, ...); mlock(ptr, 512*PAGE_SIZE); fork(); munmap(ptr + 100 * PAGE_SIZE, PAGE_SIZE); I'd expect to get two processes, each mapping the same compound THP, one with a PMD and the other with 511 ptes and one hole. Is there something different that goes on?