From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Weimer Subject: Re: [PATCH v2] mm: Add MREMAP_DONTUNMAP to mremap(). Date: Thu, 30 Jan 2020 13:19:39 +0100 Message-ID: <87eevh3zms.fsf@oldenburg2.str.redhat.com> References: <20200123014627.71720-1-bgeffon@google.com> <20200124190625.257659-1-bgeffon@google.com> <87imkxxl5d.fsf@oldenburg2.str.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: (Brian Geffon's message of "Mon, 27 Jan 2020 14:33:44 -0800") Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Brian Geffon Cc: Andrew Morton , "Michael S . Tsirkin" , Arnd Bergmann , LKML , linux-mm , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andy Lutomirski , Andrea Arcangeli , Sonny Rao , Minchan Kim , Joel Fernandes , Yu Zhao , Jesse Barnes List-Id: linux-api@vger.kernel.org * Brian Geffon: > Hi Florian, > copy_vma will make a copy of the existing VMA leaving the old VMA > unchanged, so the source keeps its existing protections, this is what > makes it very useful along with userfaultfd. I see. On the other hand, it's impossible to get the PROT_NONE behavior by a subsequent mprotect call because the mremap has to fail in some cases in vm.overcommit_memory=2 mode. But maybe that other behavior can be provided with a different flag if it turns out to be useful in the future. Thanks, Florian