Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4019428ybg; Tue, 29 Oct 2019 00:33:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAv2XLjegzqtofh9eFEHGx9Mc21Brxb/mK87pcPyCyOl0QB6xVO8CFcfhKwCOlQ5u2Tm7F X-Received: by 2002:aa7:d95a:: with SMTP id l26mr14595036eds.12.1572334388623; Tue, 29 Oct 2019 00:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572334388; cv=none; d=google.com; s=arc-20160816; b=LxjNoOPW4d/KQ9G5dPEJc6tGTYJrZWOjh3Dlf017uthRxW0DUDr5LQXMGvgbnMEVme cSNz6XjYUYnnk5yBUvOT69zilS9N7fph9cHhwXYaJLMYnnDdhiAjxMhNI5xK5eB6M6AI 7D2X/yCEXqyR3kCJIlcF7KAiLd8WNQ8TozS644FwKHrDFxjPoq5Vcy0vcv2QkW6iQAZr Ar6rMccIQdJfCPoj9LWKuofH+L/3iG0PrIY+du9Cy5MUHIPmQI2G+2KqZ42bC+es8oH4 TmOIvCJBaA8HOF/nYXr+t4zhr6YB9CVw9OTpgvR2oMJ+uYjJCZMZu6rEplcPZy23Rin/ tioQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=MGSxa8DhKCAUU2Cx2sg5xPxni5Dl5S1cZs/Zgxbg1uY=; b=zpwqQR+uEc12fJlBjSF742kdoAKz7BOsIX3jwF8MPphVtHNobw39L9vbYn5vY1bPUY 0HjC6ufqdarPn45idt9AyumszD0LkcLE/jrhs/8f0jDOD6jMm5idFEekxdWj3PpR/pA/ JpxpLNMK//O9tWYPcTAqUbhoalDnrkenVCOUYau5KV0PEB77EAdcpCpJv2reFZrrB8X8 aFtg8ZSo3f+t49LOdWyASVmfQwqfX1A74F7CVQZhE57bVHo+de7OPnP0P99VtwReJfgp KW2YAccYDG9lOk4aWfChRsUPdiKxda47px4K7jcK4dXi0sLvHRVOtgf+s9PLc+ScuWB8 uCTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t16si7873892eji.304.2019.10.29.00.32.45; Tue, 29 Oct 2019 00:33:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbfJ2HIo (ORCPT + 99 others); Tue, 29 Oct 2019 03:08:44 -0400 Received: from gentwo.org ([3.19.106.255]:37848 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbfJ2HIo (ORCPT ); Tue, 29 Oct 2019 03:08:44 -0400 Received: by gentwo.org (Postfix, from userid 1002) id D5B1F3EF13; Tue, 29 Oct 2019 07:08:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id D4C183EA21; Tue, 29 Oct 2019 07:08:42 +0000 (UTC) Date: Tue, 29 Oct 2019 07:08:42 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: "Kirill A. Shutemov" cc: Mike Rapoport , linux-kernel@vger.kernel.org, Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Dave Hansen , James Bottomley , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-api@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, Mike Rapoport Subject: Re: [PATCH RFC] mm: add MAP_EXCLUSIVE to create exclusive user mappings In-Reply-To: <20191028131623.zwuwguhm4v4s5imh@box> Message-ID: References: <1572171452-7958-1-git-send-email-rppt@kernel.org> <1572171452-7958-2-git-send-email-rppt@kernel.org> <20191028123124.ogkk5ogjlamvwc2s@box> <20191028130018.GA7192@rapoport-lnx> <20191028131623.zwuwguhm4v4s5imh@box> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Oct 2019, Kirill A. Shutemov wrote: > Setting a single 4k page non-present in the direct mapping will require > splitting 2M or 1G page we usually map direct mapping with. And it's one > way road. We don't have any mechanism to map the memory with huge page > again after the application has freed the page. > > It might be okay if all these pages cluster together, but I don't think we > have a way to achieve it easily. Set aside a special physical memory range for this and migrate the page to that physical memory range when MAP_EXCLUSIVE is specified? Maybe some processors also have hardware ranges that offer additional protection for stuff like that?